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