I've just downloaded and installed
- typeahead.bundle.min.js
- typeahead.mvc.model.js
- typeahead.css
I've followed the example given and I have a helper in my view
@Html.AutocompleteFor(model => model.NewUser.User_Org, model => model.NewUser.User_Org,"GetOrganisations", "User", false, new { htmlAttributes = new { @class = "form-control" } })
and this action method on my 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 is rendered but when I start typing, nothing happens, I would expect my action method to be hit on the controller, but it isn't. I've got all the prerequisites for typeahead and the mvc helper, yet it just wont work. Is there something I'm missing?