Tag: typeahead.js

适用于MVC 5模型的Typeahead.js

我刚刚使用Typeahead.js为MVC 5 Models包装器实现了预先输入function http://timdwilson.github.io/typeahead-mvc-model/ 一切正常但我只是想弄清楚如何设置建议下拉列表中显示的项目数量的限制。 javascript就是这个 $(‘#scrollable-dropdown-menu .typeahead’).typeahead(null, { name: ‘countries’, limit: 10, —–> limit set here source: countries }); 但我不知道mvc模型包装器如何实现这个,有三个重载,其中一个有’AdditionalViewdata’可能这是什么需要? 没有我可以找到的文档,似乎没有其他人这样做(在下拉列表中看起来默认为5)我的后端机制IS返回超过5个结果,它只是没有反映在html中 @Html.AutocompleteFor(model => model.Organisation.Org, model => model.Organisation.ORGID, “Autocomplete”, “Organisation”, false, new { htmlAttributes = new { @class = “form-control” } }) 有人可以帮忙吗?