Dojo 使用FilteringSelect+;杰森雷斯特

Dojo 使用FilteringSelect+;杰森雷斯特,dojo,dijit.form,Dojo,Dijit.form,JsonRest似乎是为用户设计的rest样式的url(例如/path/keyword) 与FitleringSelect一起使用时,查询为path/?searchAttr=关键字 是否可以将FilteringSelect设置为传递?只需将关键字传递给JsonRest存储?FilteringSelect将对象作为查询传递给存储/JsonRest。这将自动转换为JsonRest.query()中的查询字符串。如果将字符串传递给存储的查询方法,则该字符串将附加到url。因此,一个黑客解决方案是在将F

JsonRest似乎是为用户设计的rest样式的url(例如/path/keyword)

与FitleringSelect一起使用时,查询为path/?searchAttr=关键字


是否可以将FilteringSelect设置为传递?只需将关键字传递给JsonRest存储?

FilteringSelect将对象作为查询传递给存储/JsonRest。这将自动转换为
JsonRest.query()
中的查询字符串。如果将字符串传递给存储的查询方法,则该字符串将附加到url。因此,一个黑客解决方案是在将FilteringSelect的查询属性传递到存储之前,通过对
\u startSearch()
方法进行猴子修补来修改该属性,例如:

var myFilter = new FilteringSelect(...),
   oldStartSearch = myFilter._startSearch;

myFilter._startSearch = function(text) {
    this.query = text;
    oldStartSearch.call(this, text);
};