德鲁·威尔逊 AutoSuggest 和 Ajax
我正在尝试让 Ajax 与这个插件一起使用。
我有这个代码;
$.post("/Search/jQuery_GetSkillList", { q:""}, function (jSonData) {
$("#AutoSuggest").autoSuggest(jSonData, { selectedItemProp: "name", selectedValuesProp: "value", searchObjProps: "name", startText: "Type skills here" });
});
效果很好,但潜在的项目有 1,000 个,所以我真的需要它在您键入时工作。
所以我尝试这个;
$("#AutoSuggest").autoSuggest("/Search/jQuery_GetSkillList", { selectedItemProp: "name", selectedValuesProp: "value", searchObjProps: "name", startText: "Type skills here" });
在这两种情况下,我的控制器都被正确调用并且返回相同的数据。
但是,第二个代码片段不会呈现返回的结果,而第一个代码片段则会呈现。
有什么想法吗?
I am trying to get Ajax to work with this plugin.
I have this code;
$.post("/Search/jQuery_GetSkillList", { q:""}, function (jSonData) {
$("#AutoSuggest").autoSuggest(jSonData, { selectedItemProp: "name", selectedValuesProp: "value", searchObjProps: "name", startText: "Type skills here" });
});
which works fine but the potential items is in the 1,000's so I really need it to work as you type.
So I try this;
$("#AutoSuggest").autoSuggest("/Search/jQuery_GetSkillList", { selectedItemProp: "name", selectedValuesProp: "value", searchObjProps: "name", startText: "Type skills here" });
My controller, in both instances, is being called correctly and it returns the same data.
However, the second code snippet does not render the returned results whereas the first does.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于那些感兴趣的人,我找到了答案。
我包含了该控件的未打包版本,并找到了一行
$.json
并将其改为$.post
,现在该控件工作得非常好。感谢那些花时间在这上面的人。
For those that are interested I found the answer.
I included the un-packed version of the control and located a line that said
$.json
and made it$.post
instead and now the control works very very well.Thanks to those that spent time on this.