In 19.2 grid, there is no way to set the identifier for the rows of data. When selecting a row, the identifier is set to the row selected.This is all good, but lets say I have an initial grid that has 7 rows of data:
{{id: 3, name: 'Apple'},
{id: 33, name: 'Beet'},
{id: 4, name: 'Corn'},
{id: 18, name: 'Donut'},
{id: 23, name: 'Duck'},
{id: 43, name: 'Pear'},
{id: 33, name: 'Watermelon'}}
and it's sorted by name alphabetically. If I were to selected Apple and Corn, 1;3 would be saved into local!selected. Then If I were to filter the grid to only return Corn and I deselected that, 1 is removed from local!selected, and when I clear out the filter , Corn is still selected while Apple is now deselected. Is there a way to get around this and have identifier set to the primary key of the cdt?
Discussion posts and replies are publicly visible
Selection in the 19.2 paging grids defaults to the value of identifiers within your dataSubset, if you're using a dataSubset for the data parameter (which you should when possible). I believe a!queryEntity automatically sets the Primary Key ID as "identifiers" in its return.
So the grid is using local!dataSubset, and I've tested the query rule, the identifier returned does not match the primary key of the cdt.
Would you be able to post a screenshot of your CDT definition? Or at least the top part including the primary key row.
This is the cdt.
and this is the query rule result filtering the primary key of {1, 45}
Definitely weird - and in your expression rule, are you just doing a standard query entity? All the ones I'm trying are behaving as expected (with the identifier list returned matching the primary key IDs).
Could you post a screenshot and/or example code snippet of your query rule?
so yeah, we were casting the results of our query entity to the type of the cdt. Without that the identifiers are matching the primary key of the cdt. I will have to retest the grid with that. Thank you