Opened 9 years ago

Closed 6 years ago

#10432 closed defect (wontfix)

JsonQuery.js sort part generation

Reported by: petteri Owned by: Kris Zyp
Priority: high Milestone: tbd
Component: DojoX Data Version: 1.4.0b
Keywords: Cc:
Blocked By: Blocking:

Description

jsonQuery.js fails to correctly form sort part of query as ternary operation with simplifiedQuery is not enclosed in round brackets.

Expected query:

resourcePath/[/@['sortAttribute']][:25]

Resulting query:

resourcePath/sortAttribute][:25]

Attachments (1)

JsonQuery.js.diff (689 bytes) - added by petteri 9 years ago.

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by petteri

Attachment: JsonQuery.js.diff added

comment:1 Changed 9 years ago by Jared Jurkiewicz

Owner: changed from Jared Jurkiewicz to Kris Zyp

comment:2 Changed 9 years ago by DanielWiklund

I also came across this problem. I use a DataGrid? with a JsonQueryRestStore?.

After some troubleshooting, I think I found the cause of the problem.

In the Dojox\Data\Util\JsonQuery?.js on line 55 it says:

_1.queryStr+=(_3?"[":",")+(_d[i].descending?"%5C":"%2F")+_4.simplifiedQuery?encodeURIComponent(_d[i].attribute):("@+dojo._escapeString(_d[i].attribute)+?");

The problem here seems to be that there are brackets missing around the third part of the statement:

_4.simplifiedQuery?encodeURIComponent(_d[i].attribute):("@+dojo._escapeString(_d[i].attribute)+?"

If you add brackets resulting in the following line, it seems to work:

_1.queryStr+=(_3?"[":",")+(_d[i].descending?"%5C":"%2F")+(_4.simplifiedQuery?encodeURIComponent(_d[i].attribute):("@+dojo._escapeString(_d[i].attribute)+?"));

comment:3 Changed 6 years ago by Colin Snover

Resolution: wontfix
Status: newclosed

dojox/data is abandoned. Some dojox/data stores have been upgraded to use the Dojo Store API and can be found at https://github.com/kfranqueiro/dojo-smore.

Note: See TracTickets for help on using tickets.