javascript - Typeahead.js for mvc5 models -
i've downloaded , installed
- typeahead.bundle.min.js
- typeahead.mvc.model.js
- typeahead.css
i've followed example given , have helper in view
@html.autocompletefor(model => model.newuser.user_org, model => model.newuser.user_org,"getorganisations", "user", false, new { htmlattributes = new { @class = "form-control" } })
and action method on controller
[actionname("getorganisations")] [validateantiforgerytoken] public actionresult getcombodata(string search) { jsonresult result = new jsonresult(); if (!string.isnullorempty(search)) { getorganisationrequestnonprimary request = new getorganisationrequestnonprimary(search); result.jsonrequestbehavior = jsonrequestbehavior.allowget; var organisations = this._organisationservice.organisationautocomplete(request); result.data = organisations.organisations.asqueryable(); result.jsonrequestbehavior = jsonrequestbehavior.allowget; } return result; }
the input box rendered when start typing, nothing happens, expect action method hit on controller, isn't. i've got prerequisites typeahead , mvc helper, yet wont work. there i'm missing?
Comments
Post a Comment