I'm using a JsonQueryRestStore with ClientFilter option to cache queries and data, to unload the server of some repeated xhr interrogation for data already sent to the client.
The code I wrote works fine, except a minor issue. I have a Filtering select where the user type and get the available choices restricted. This field does not have a specific case, so typing "mi", "MI", "Mi" you get the same result choice all uppercase. The problem is that even if i use the option: queryOptions: {ignoreCase: true} and/or uppercase: true on the field it seem that ClientìFilter ignore that and query the server for every case combination, so it caches every one as different one. I.e for two letter you can have 4 combinations: mi, MI, Mi, mI
Now if this is not handled correctly by ClientFilter I would like to force all input uppercase. But I can't get it working.. ClientFilter send and cache the query as the user typed it, even if i try to convert it.
Any idea how I could solve this?
my simplified code below javascript:
dojo.require('dojox.data.FilteringSelect');
dojo.require('dojox.data.ClientFilter');
dojo.require('dojox.data.JsonQueryRestStore');
var fooselect = new dijit.form.FilteringSelect({
id : "fooId",
store: new dojox.data.JsonQueryRestStore({ target: '/fooajax', labelAttribute: 'description', cacheByDefault: true }),
searchAttr : "descrip开发者_StackOverflow中文版tion",
searchDelay : 300,
autocomplete : true,
uppercase: true,
trim : true,
required : ${required},
queryOptions: {ignoreCase: true}
}, "fooInput");
html:
<input id="fooInput">
In queryOptions can you add cache key with true value, like this.
queryOptions="{cache: true,ignoreCase: true}"
Please let us know whether it worked. Ref. URL. http://mikoskay.net/158-client-side-sorting-with-jsonreststore.html
精彩评论