#11565 closed defect (fixed)
dojox.data.util.JsonQuery producing broken sort syntax in query strings
Reported by: | Nick Fenwick | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | high | Milestone: | 1.6 |
Component: | DojoX Data | Version: | 1.5 |
Keywords: | dojox jsonquery _toJsonQuery sort | Cc: | |
Blocked By: | Blocking: |
Description
I have a DataGrid? using a JsonQueryRestStore? for data, pointing at my Java servlet for data. This had been working well with my custom Service object, but today I tried leaving out the 'service' attribute to JsonQueryRestStore?, so that it uses the default service instead. This causes it to use dojox.data.util.JsonQuery? to build the query sent to the backend, and I ran into this problem.
For example, I query by an attribute 'token', with a sort field 'configKey' and pagination turned on, for example I'm viewing a DataGrid? of my config data (which works fine before I try to sort) and click the Key column (field name 'configKey') to sort by that field.
You can simulate the query building with this JS:
var args = { count: 25, start: 25, isRender: false, query: { token: 'foobartokenwibble' }, sort: [ { attribute: 'configKey', descending: true } ], queryOptions: undefined }; var jq = new dojox.data.util.JsonQuery(); jq._toJsonQuery(args, true);
The resulting string:
[?(@.token='foobartokenwibble')][\@['configKey'][25:50]
Note that 'configKey' is surrounded by mismatched square brackets.
Running this same code against dojo 1.4 (Google CDN) gives a correct result:
[?(@.token='foobartokenwibble')][\@['configKey']][25:50]
I doubt attaching a test case will make this clearer, but I will do so anyway :)
Attachments (2)
Change History (6)
Changed 12 years ago by
Attachment: | dojo15.html added |
---|
comment:1 Changed 12 years ago by
Owner: | changed from Jared Jurkiewicz to Kris Zyp |
---|
Changed 12 years ago by
Attachment: | 11565.patch added |
---|
One-line fix to JsonQuery?.js to add the missing close square bracket
comment:2 Changed 12 years ago by
I'm surprised this hasn't got any attention.. am I imagining things? :)
I just attached a one-liner fix, which I'm using locally and works for me.
comment:3 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 Changed 12 years ago by
Milestone: | tbd → 1.6 |
---|
Simple test case, uses google cdn.