#6690 closed defect (worksforme)
QueryReadStore + ComboBox / FilteringSelect + paging
Reported by: | guest | Owned by: | haysmark |
---|---|---|---|
Priority: | high | Milestone: | 1.2 |
Component: | Dijit - Form | Version: | 1.1.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Using the exemple provided at http://archive.dojotoolkit.org/nightly/checkout/dojox/data/tests/QueryReadStore.html
1) Set the page to 10 2) ChangeQueryReadStore?.php to send only 10 results
$allItems = array( array('name'=>"Alabama", 'label'=>"<img src='images/Alabama.jpg'/>Alabama", 'abbreviation'=>"AL"), array('name'=>"Alaska", 'label'=>"Alaska", 'abbreviation'=>"AK"), array('name'=>"American Samoa", 'label'=>"American Samoa", 'abbreviation'=>"AS"), array('name'=>"Arizona", 'label'=>"Arizona", 'abbreviation'=>"AZ"), array('name'=>"Arkansas", 'label'=>"Arkansas", 'abbreviation'=>"AR"), array('name'=>"Armed Forces Europe", 'label'=>"Armed Forces Europe", 'abbreviation'=>"AE"), array('name'=>"Armed Forces Pacific", 'label'=>"Armed Forces Pacific", 'abbreviation'=>"AP"), array('name'=>"Armed Forces the Americas", 'label'=>"Armed Forces the Americas", 'abbreviation'=>"AA"), array('name'=>"California", 'label'=>"California", 'abbreviation'=>"CA"), array('name'=>"Colorado", 'label'=>"Colorado", 'abbreviation'=>"CO") );
The comboBox widget and FilteringSelect? widget will display 10 results : Alabama -> Colorado + "More choice" item
But there is no more choices as there is only 10 results !
The problem come from dijit.form._ComboBoxMenu
createOptions:function this.nextButton.style.display=dataObject.count==results.length?"":"none";
This line indicates that "Next" button must be displayed if "retrieved results count" == "pageSize".
But this is not the right test to know if there more elements to display. Only the server-side can determine this.
Ektor.
Attachments (2)
Change History (13)
comment:1 Changed 13 years ago by
Component: | General → DojoX Data |
---|---|
Owner: | changed from anonymous to Jared Jurkiewicz |
comment:2 Changed 13 years ago by
This is a widget problem. The widget can know how many total matches there on by looking at onBegin to see how many total matches there were for a particular query (providing the datastore reports it. If the widget gets -1, all it can do is guess).
But I know QueryReadStore? properly returns to onBegin. SO, it's a problem with the widget not listening to onBegin and setting expectations based on that. (On whether there is more or not).
Changed 13 years ago by
Attachment: | dijit.form.ComboBox_20080507.patch added |
---|
Patch to make ComboBox? smarter on how it determines if 'more' should be shown.
comment:3 Changed 13 years ago by
Component: | DojoX Data → Dijit |
---|---|
Owner: | Jared Jurkiewicz deleted |
Routing over to the dijit folks for review. Don't claim the patch is beautiful, just something quick I worked up this afternoon after looking at the ComboBox? code for a few minutes.
comment:4 Changed 13 years ago by
Milestone: | → 1.2 |
---|---|
Owner: | set to haysmark |
Looks fine to me; if OK to Mark then I'll check it in.
comment:5 Changed 13 years ago by
I looked at Jared's code today and I couldn't get it to patch against the trunk. I merged the changes manually and I'm going to attach a new patch.
Changed 13 years ago by
Attachment: | 6690.patch added |
---|
comment:6 Changed 13 years ago by
Bill, I think it is ok to commit this patch. I just attached a new one with more recent line numbers.
comment:7 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:8 Changed 13 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I have do a simple test for this changeset it can work when there's only 2 pages , but when there's more pages it seems can't show more that 2 pages. I have gone throw the codes and in the debug i found seems there's some problem when judge whether should show "more choice".
Can anybody recheck the codes in changeset 13726 and do more tests? Thanks !
PS: i also want to know when will this changeset can be built in the formal package, thanks~
comment:9 Changed 13 years ago by
Post the code for your simple test.
We have many tests with more than 2 pages and they all work. The QueryReadStore? test linked in the description has a pageSize of 5 and shows lots of pages. Also, using test_ComboBox I verified that the second ComboBox? with ItemFileReadStore? worked when I set 62 items in the data store and set the pageSize to 31 (exactly 2 pages) and 62 (exactly 1 page).
comment:10 Changed 13 years ago by
Resolution: | → worksforme |
---|---|
Status: | reopened → closed |
comment:11 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|
Jared, can you assess and assign to Dijit if appropriate?