Search code examples
jqueryasp.net-mvcmodel-view-controllerautosuggest

Drew Wilson AutoSuggest and Ajax


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?


Solution

  • 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.

    </griegs>