Kendo UIでは、オートコンプリート ボックスを使用して、サーバーからデータを取得しようとしています。次の署名でASP.NET MVCコントローラーをヒットしています。
public ActionResult aspect(string term){
// ...
}
これは、リクエストの URL に正しいパラメーターが含まれている必要があることを意味します。今私が直面している問題は、dataSourceメカニズムでこれを指定する方法を見つけることができないということです。parameterMapに関するドキュメントを何十回も読みましたが、まったく意味がありません。
これは、問題のページには実際には一度に 10 ~ 15 個のオートコンプリートテキスト ボックスがあり、それぞれが動的 ID で動的に作成されるため、さらに複雑になります。
これまでに使用したコードは次のとおりです。
$(".autocomplete").kendoAutoComplete({
dataTextField: "Name",
dataSource: {
type: "json",
transport: {
read: {
url: "/search/aspect"
}
}
}
});
それで、渡すパラメータに名前を付ける方法を伝えるためにできることはありますか?
私がやろうとしていることをより明確にするために、これをjQueryで行っている場合は ... を使用します
$.ajax({ url: '/search/aspects', data: { term: (insert the data here) } });
しかし、これらすべてが機能するため、オートコンプリート入力を取得するための「セレクター」が設定されていないため、入力フォーム要素からその値を取得できません。