Opened 10 years ago
Closed 10 years ago
#15726 closed defect (fixed)
[regression] FilteringSelect: "more choices" doesn't appear for async dojo.data store
Reported by: | charly | Owned by: | bill |
---|---|---|---|
Priority: | blocker | Milestone: | 1.8 |
Component: | Dijit - Form | Version: | 1.8.0rc1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Hello,
Code:
<div data-dojo-type="dojox.data.QueryReadStore" data-dojo-id="store_customer" data-dojo-props="url:'MYURL', requestMethod:'get', doClientPaging:'true', doClientSorting:'false'"> </div> <input name="fs_offercustomer" id="fs_offercustomer" value="" type="text" data-dojo-type="dijit.form.FilteringSelect" data-dojo-props="store:store_customer, placeHolder:'Search Customer', searchDelay:400, searchAttr:'name', labelAttr:'name', highlightMatch:'all', required:false, autoComplete:false, labelType:'html', hasDownArrow:false, trim:true, pageSize:5, fetchProperties:{start:0, count:5}">
Problem:
- I use FilteringSelect? with QueryReadStore?, when I return any suggestions form the store I miss an option "more choices". But when I try the same input a 2nd time I get the option.
- When I go to the last page, it appears only more/previous choices without list items.
- In Dojo 1.7.2 I don't use pageSize:5 only fetchProperties and it works but not in 1.8.0rc1.
Similar Ticket: 13339 ;
thx charly
Attachments (3)
Change History (13)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Component: | Dijit - Form → DojoX Data |
---|---|
Milestone: | tbd → 1.8.1 |
Owner: | changed from Douglas Hays to bill |
Status: | new → assigned |
bill, can you look at this? It's another QueryReadStore issue. The total value is coming back with the pagesize set in dojo/store/util/QueryResults.js the first time. After that, total gets reset to the real value in the compatibility API ComboBoxMixin::query::onBegin.
comment:3 Changed 10 years ago by
Cc: | Douglas Hays added |
---|---|
Component: | DojoX Data → Dijit - Form |
Summary: | FilteringSelect: "more choices" is away → FilteringSelect: "more choices" doesn't appear first time |
It's apparently not a QueryReadStore issue since I can reproduce the problem in dijit by setting pageSize:10 on the "Artificially slowed-down data store" in dijit/tests/form/autoComplete.html. But I'll take a look anyway because I think it's in my back-compat code code in ComboBoxMixin.js to support old dojo.data stores.
comment:4 Changed 10 years ago by
Cc: | Douglas Hays removed |
---|---|
Milestone: | 1.8.1 → 1.8 |
Owner: | changed from bill to Douglas Hays |
Summary: | FilteringSelect: "more choices" doesn't appear first time → [regression] FilteringSelect: "more choices" doesn't appear for async dojo.data store |
Actually, it broke from your [28065]. I have a patch that seems to fix it but I'll let you check it over, and check in. I didn't run the full regression test.
This seems like a candidate to slip into 1.8 final, because it's a serious regression, isn't it? Too bad our unit tests didn't pick up on it, we need to add a test for paging from an async store.
Changed 10 years ago by
Attachment: | fix_total.patch added |
---|
set total correctly, it needs to be either available immediately, either as a promise or a scalar value
comment:5 Changed 10 years ago by
PS: Results.total should be set at the start of the query, either set to a value or to a promise.
Since results.total is not set before query() returns, and since it's not even set when the "results" promise resolves, this code in QueryResultsStore kicks in, which incorrectly sets the total to be the pageSize, assuming that pageSize <= the actual number of rows that matched the query:
if(!results.total){ results.total = Deferred.when(results, function(results){ return results.length; }); }
comment:6 Changed 10 years ago by
PPS: same bug needs to be fixed at http://bugs.dojotoolkit.org/browser/dojo/dijit/trunk/form/_FormSelectWidget.js#L272
comment:7 Changed 10 years ago by
Priority: | undecided → blocker |
---|
comment:8 Changed 10 years ago by
For the record, [28065] just exposed a bug in the dojo.data (old API) support code that was there all along.
Anyway, I ran the regression and the change (fix_total_2.patch) looks OK.
comment:9 Changed 10 years ago by
Owner: | changed from Douglas Hays to bill |
---|
bill, the patch looks good. I added an automated testcase for good measure. I agree that this should go into 1.8. Refs #12373. dojox/data/demos/demo_QueryReadStore_FilteringSelect.html shows "More choices" now as well.
Problem: