我有一个带有 JsonRest 对象的 Dojo EnhancedGrid,它包含在 ObjectStore 中。我想将我的过滤条件发送到服务器。
我这样做的代码几乎完全是:
var myStore = new JsonRest({target:"data.jsp"});
var grid = new dojox.grid.EnhancedGrid({
store: dataStore = new ObjectStore({objectStore: myStore}),
id:"grid",
query: { fileId: "*" },
structure:"mystructure",
plugins:{
filter: {
isServerSide: true,
setupFilterQuery: setupFilter
}
}
});
var setupFilter = function(commands, request){
if(commands.filter && commands.enable){
request.query.filter = JSON.stringify(commands.filter);
}
};
问题是 commands.filter 似乎没有保存有效的日期对象。在 Firefox 的代码调试器中查看它,它似乎包含数字(内存地址?)日期应该在哪里。
JSON.stringify(commands.filter)
日期范围查询的示例结果是:
{"op":"all","data":[{"op":"largerEqual","data":[{"op":"date","data":"uploadDate","isCol":true },{"op":"date","data": 1382706000000 ,"isCol":false}]},{"op":"lessEqual","data":[{"op":"date","数据":"uploadDate","isCol":true},{"op":"日期","数据": 1381150800000 ,"isCol":false}]}]}
如何在过滤条件中包含有效日期?