Here is the code I've been trying to use:
cnt.Add(Html.X().FieldContainer()
.Layout(LayoutType.HBox)
.Padding(10)
.Margins("0 0 0 0")
.Items(fields =>
{
fields.Add(Html.X().ComboBox()
.Width(700)
.FieldLabel("Customer/Organisation Name")
.Margins("0 0 4 0")
.LabelWidth(200)
.MinChars(1)
.DisplayField("OrganisationName")
.ValueField("OrganisationName")
.HideBaseTrigger(true)
.TypeAhead(false)
.Cls("form-label")
.ListConfig(Html.X().BoundList()
.LoadingText("Searching...")
.Height(200)
.ItemTpl(Html.X().XTemplate()
.Html("<div class=\"search-item\"><h3><span>{PartyID}</span>{OrganisationName}</h3>{OrganisationCode}</div>")
)
)
.Store(store => Html.X().Store()
.Proxy(proxy => proxy.Add(Html.X().AjaxProxy()
.Url("/Party/GetOrganisations/")
.Reader(reader => reader.Add(Html.X().JsonReader()
.Root("data")
.TotalProperty("total")
))
))
.Model(model => model.Add(Html.X().Model()
.Fields(modelFields =>
{
modelFields.Add(Html.X().ModelField().Name("OrganisationName"));
modelFields.Add(Html.X().ModelField().Name("OrganisationCode"));
modelFields.Add(Html.X().ModelField().Name("PartyID"));
}) ))
)
);
})
);
The route to the /
Party/GetOrganisations method is definitely working as I can bind to other controls and also see the raw JSON if i enter it directly as the URL, but when I try to trigger it using the combobox as a "custom search" box as per the example, the method never gets triggered...