ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Autocomplete, combobox and dropdown client side item matching
Title:
B
I
{code}
?
I have an Autocomplete which gets a list of JSON array from the server based on the search term typed by the user. The returned items contain a custom field besides the k and c or Name fields. I want to overwrite/change the *client side item matching* for the displayed autocomplete list based on the introduced search term. I want to display to the user only certain items which match not only the *c* or *Name* (content) property of the item, but also a custom property aswell. Example: display all items where *c* or a *customProp* contains the user typed text. The JS function should be in the awem.js, but i could not track it down... This problem also applies to combobox/odropdown. Could you point me in the right direction? There should be an option for Autocomplete and all the dropdown controls, which implement server side search, to display the returned list from the server without trying to match/filter the returned list with the introduced text (i already did all the filtering/matching serverside, i do not need client side matching aswell) Autocomplete used: @(Html.Awe().AutocompleteFor(model => model.Text).PropId(model => model.TextID) .Url(Url.Action("GetItem", new { area = "TestArea", controller = "ctrlr" })) .Placeholder("Type...").MinLength(2).Delay(150) .HtmlAttributes(new Dictionary<string, object> { { "class", "form-control form-control-sm" } }) .Parameter("addNesp", "false") .Parameter("nrOfItems", "20")) Dropdown/Combobox: @(Html.Awe().AjaxRadioListFor(model => model.LocalitateID) .Combobox(o => o.AutoSelectFirst() .SearchFunc("utils.osearch", Url.Action("GetItem", new { area = "TestArea", controller = "ctrlr", addNesp = "false", nrOfItems = "20" }), "m1", true)) .Url(Url.Action("GetItem", new { area = "TestArea", controller = "ctrlr" })) .Load(false) .CssClass("form-control form-control-sm p-0") .HtmlAttributes(new { @style = "border: 0px;" }) .Parameter("addNesp", "false") .Parameter("nrOfItems", "20"))
Save Changes
Cancel
Albert Kalman
asked at 07 Jun 2019
Answers
B
I
{code}
?
This is not configurable at this moment, but you can try to hardcode it for now. In `awem.js` find `function renderNodes`, and inside it this line: var cont = unescf(cp(item)); modify it to: var cont = unescf(cp(item) + ' ' + item.SrcKeywords); // in asp.net core it might need to be lowercased `srcKeywords` and on the server side you could inherit `KeyContent` to create a new type that has `SrcKeywords`
Save Changes
Cancel
Omu
answered at 07 Jun 2019
Thanks, it is exactly what i was looking for.
at 07 Jun 2019
Albert Kalman
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK