#14895 closed defect (fixed)
Paging problems with FilteringSelect using a JSON REST store
Reported by: | Paul Christopher | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | undecided | Milestone: | 1.8 |
Component: | Dijit - Form | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Description
I have to confirm what has already been pointed out by James Shaw: http://dojo-toolkit.33424.n3.nabble.com/FilteringSelect-paging-using-a-JsonRest-store-in-Dojo-1-7-td3770061.html
The paging functionality for FilteringSelects using JSON REST stores seems to be broken somehow if the total results number is an integral multiple of pageSize. If so, the last page still displays a "More options" link although there are no more options available.
Steps to reproduce the issue
Set up a FilteringSelect which uses a JSON Rest Store as data source. Set the pageSize to e.g. 5. Make sure that a certain query has a total results number of 10, 15 or 20, i.e. total results needs to be an integral multiple of pageSize. Click through the pages. The last page still shows a "More options" link although there are no more options available.
Discussion
The mail by James Shaw gives some information which code parts might cause the problem.
Attachments (1)
Change History (7)
comment:1 Changed 10 years ago by
Component: | Dijit - Form → Data |
---|---|
Owner: | changed from Douglas Hays to Kris Zyp |
comment:2 Changed 10 years ago by
Yes, this is correct, the results.total is a deferred object because it is resolved asynchronously.
comment:3 Changed 10 years ago by
Component: | Data → Dijit - Form |
---|---|
Owner: | changed from Kris Zyp to Douglas Hays |
So, I think FilteringSelect needs to handle this using a Deferred.when(total, ...), since total could be a Promise or a scalar value. Guess we also need a test case against JsonStore, probably using a PHP file to serve the requested data.
Changed 10 years ago by
Attachment: | 14895.patch added |
---|
patch to implement nested Deferred.when calls
comment:4 Changed 10 years ago by
Milestone: | tbd → 1.8 |
---|---|
Status: | new → assigned |
Paul, can you please try out the attached patch to see if it works for you?
comment:6 Changed 10 years ago by
Yep, this works for me now. I could not find _SearchMixin.js in Dojo 1.7.2, but could find it in the latest nightly builds. I downloaded the latest builds and it works there. Thanks Doug!
From James Shaw,
... A bit of investigation has shown that within dojo.store.JsonRest?.query, the
block appears to parse the Content-Range header correctly, however the returned value isn't being assigned to results.total, with it being assigned the Deferred object instead. ...