Opened 13 years ago
Closed 13 years ago
#6017 closed defect (fixed)
Grid + DojoData model causes unnecessary call to fetch
Reported by: | guest | Owned by: | benschell |
---|---|---|---|
Priority: | high | Milestone: | 1.1 |
Component: | DojoX Grid | Version: | 1.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Firefox 2.0.0.12 Windows Vista
Calling DojoData.refresh() results in two calls to the dojo.data implementation.
Attachments (1)
Change History (5)
comment:1 Changed 13 years ago by
Owner: | changed from sorvell to benschell |
---|
comment:2 Changed 13 years ago by
Milestone: | → 1.1 |
---|
comment:3 Changed 13 years ago by
Status: | new → assigned |
---|
The original intention of the clearData function introduced on the DojoData? model in #5555 / [12040] was to clear the data displayed in the Grid without doing any re-query-ing to the data store. If the user wished to have the data store re-queried, a 'refresh' function was provided in the same patch to provide this functionality.
However, the count variable on the data store was not reset. Therefore, despite the data array being cleared, the Grid, when notified that the data had been changed (due to an AllChange? notification during setData), believed that there was still data present and would then re-query the data store. Therefore, two bugs arose: if calling clearData, the store would be re-queried AND using model.refresh() would result in two queries to the data store, one due to the clearData/setData (same bug, really).
The fix is to simply reset the count of items when clearing the data array.
The patch includes two fixes. The first is a change to the existing test page (test_dojo_data_edit.html). The bug can be demonstrated by clicking the 'Clear Data (Model)' button, which calls clearData on the model. The expected behavior is that the model's data is cleared *without* a re-query, however the store is re-queried and the Grid refreshes with the data. The second is the fix to the bug, which results in the same test producing a cleared Grid (with no data displayed).
Changed 13 years ago by
Attachment: | 6017.patch added |
---|
comment:4 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Worked with reporter on this, grabbing to work on.