我指的是使用http://www.sitepen.com/blog/2008/03/17/jsonpath-support/
这就是我正在做的(花了两天但没有运气):首先绘制一个带有整数列和日期列的数据网格,并且还能够通过单击列标题对列值进行排序..
现在使用 dojox.jsonPath.query 使用类似的语法查询数字
jsonStore = new dojox.jsonPath.query(object,"[?(@.+ field1 > 500)]");//works fine
(使用 jsonStore 重绘网格).. 到目前为止一切正常。
但是现在尝试使用 jsonPath 过滤掉 dojo 数据网格的另一列上的日期。
var dt = new Date();
jsonStore = new dojox.jsonPath.query(object,"[?(@.effectiveDate<" + dt + ")]");// does not work
// I am trying to get the rows of the grid which have effectiveDate date less
// than cuurent date or any other passed 'javascript date object'
layout = [{"field":"field1","name":"field1"},{"type":dojox.grid.cells.DateTextBox,"field":"effectiveDate","name":"effectiveDate","formatter":formatDate}];
其中 EffectiveDate 是 dojo 数据网格布局的字段。但上述方法不起作用并引发以下错误“jsonPath: missing ; before statement: _v.effectiveDate
我应该如何使用 jsonPath 来查询日期,或者我的语法是错误的?
有没有一种方法可以使用 dojox.jsonPath.query 或 dojox.json.query 使用 <、<=、>=、= 运算符来查询 json 对象中的日期对象......?
有什么帮助吗?