0
我有一個網格至極商店是一個QueryReadStore。它工作正常,甚至虛擬滾動。 問題是過濾器,當我進行篩選,它會產生一個奇怪的網址是這樣的:使用QueryReadStore過濾網格
http://mydomain:8080/project=%3F&1=f&2=i&3=l&4=t&5=e&6=r&7=......
我想是這樣的:
http://localhost:8080/project?filter={%22op%22:%22contains%22,%22data%22:[{%22op%22:%22string%22,%22data%22:%22username%22,%22isCol%22:true},{%22op%22:%22string%22,%22data%22:%22s%22,%22isCol%22:false}]}
這裏是生成網格和代碼過濾:
this.grid = new EnhancedGrid({
store: null,
structure: this.columns,
rowsPerPage: 20,
autoHeight: false,
plugins: {
filter: {
closeFilterbarButton: false,
isServerSide: true,
setupFilterQuery: dojo.hitch(this, function(commands, request){
if(commands.filter && commands.enable){
var gridStoreURL = this.grid.store.url;
if(gridStoreURL.indexOf("?") > -1) {
request.query = "&filter=" + JSON.stringify(commands.filter);
} else {
request.query = "?filter=" + JSON.stringify(commands.filter);
}
}else{
}
}),
ruleCount: 3,
itemsName: "logs",
disabledConditions: {anycolumn : this.disabledFilterAnyColumn}
}
}
}, this.idGridContainer);
我創建存儲使用此項功能:
var store = dojox.data.QueryReadStore({
url : this.urlBase + agentId,
requestMethod:"get"
});
this.grid.setStore(store, null, null);
當我使用JsonStore創建商店時,過濾器可以正常工作,但是這不會。
預先感謝您
真棒!工作,非常感謝你! – Juanjo 2014-10-29 15:08:22