Opened 11 years ago

Closed 8 years ago

#11502 closed enhancement (patchwelcome)

dojox.grid.DataµGrid && : 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:


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 :

Change History (7)

comment:1 Changed 11 years ago by Jared Jurkiewicz

Resolution: invalid
Status: newclosed

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.

comment:2 Changed 11 years ago by bill

Resolution: invalid
Status: closedreopened
Summary: dojox.grid.DataµGrid && : newItem problemdojox.grid.DataµGrid && : all new items appear in grid, even when they don't match grid's query
Type: taskenhancement

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 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 11 years ago by Jared Jurkiewicz

Component: DojoX DataDojoX Grid

Agreed. This is a grid documentation update, not a bug in a datastore.

comment:4 Changed 11 years ago by Jared Jurkiewicz

Owner: changed from Jared Jurkiewicz to Bryan Forbes
Status: reopenednew

comment:5 Changed 11 years ago by bill

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 bill

DojoX Grid and EnhancedGrid are deprecated in favor of dgrid and gridx.

You should upgrade your code to use one of those two grids.

We will consider patches to the old DojoX Grid code though.

comment:7 Changed 8 years ago by bill

Resolution: patchwelcome
Status: newclosed
Note: See TracTickets for help on using tickets.