Opened 11 years ago
Closed 8 years ago
#11502 closed enhancement (patchwelcome)
dojox.grid.DataµGrid && dojox.data.JsonStore : all new items appear in grid, even when they don't match grid's query
Reported by: | Ran Mory | Owned by: | Bryan Forbes |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | DojoX Grid | Version: | 1.4.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Hi All, I have several tabs(dijit.layout.ContentPane?) that list customers records in each of these tabs I have a grid that lists the addresses of each customer, the address grids use the same address store with a query ("customerId" = activeCustomerId) my problem is: when I open multiple customer tabs (that means several grids displays), and I do newItem on the grid of the active customer , it adds item in all grids displays, please can you show me where does the problem come from? the store used is : dojox.data.JsonRestStore?
Change History (7)
comment:1 Changed 10 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 Changed 10 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Summary: | dojox.grid.DataµGrid && dojox.data.JsonStore : newItem problem → dojox.grid.DataµGrid && dojox.data.JsonStore : all new items appear in grid, even when they don't match grid's query |
Type: | task → enhancement |
The thing is that each grid in the example has a query ("customerId" = activeCustomerId) set on it. So new items added to the data store shouldn't appear in the grid unless they match the query. Yet, all new items appear in the grid.
Of course, internally, that's because the dojo.data API has no way of testing whether a single item matches the query or not... this is known limitation in Grid, but undocumented, so it's confusing for users. Technically speaking the dojox.Grid.query parameter has no documentation whatsoever, at least no API documentation, but it seems natural to assume that it's applied to new records as well as old records.
So I think this ticket is valid, albeit more of an enhancement request than a bug. In the short term we should write documentation for dojox.grid.query stating that it doesn't work for new items.
Does that all make sense?
comment:3 Changed 10 years ago by
Component: | DojoX Data → DojoX Grid |
---|
Agreed. This is a grid documentation update, not a bug in a datastore.
comment:4 Changed 10 years ago by
Owner: | changed from Jared Jurkiewicz to Bryan Forbes |
---|---|
Status: | reopened → new |
comment:5 Changed 10 years ago by
Yah, documentation or optimistically some day [some of] the stores will have a matchesQuery(item, query) method to test if a particular item matches a query.
comment:6 Changed 8 years ago by
comment:7 Changed 8 years ago by
Resolution: | → patchwelcome |
---|---|
Status: | new → closed |
You're using the same store instance for each Grid, I expect, which means they all get updated when an onNew event fires on the store. If you don't want that, use a unique store per grid.