【发布时间】:2014-10-29 10:28:32
【问题描述】:
我有一个网格至极存储是一个 QueryReadStore。它工作正常,即使是虚拟滚动。 问题是过滤器,当我过滤时,它会生成一个像这样的奇怪 URL:
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 创建商店时,过滤器可以正常工作,但这样就不行了。
提前谢谢你
【问题讨论】: