Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

How can I prevent duplicates in local ListGrid when data is filtered?

$
0
0
Not sure how common this request might be, but we're trying to use a ListGrid as a local record store. That is, this ListGrid is populated manually using data from other ListGrids. And this data is later retrieved using getDataAsRecordList().

This works perfectly, except when any sort of filtering is brought into play.

Let's say the user has a list of records that they'd like to filter for viewing purposes. However, when an existing record has been filtered out and then the same record is added by a drag and drop from another ListGrid, the duplicate prevention does not trigger and the record is added. Removing the filter from this ListGrid then displays both records (aka. a duplicate).

Additionally, when the user "saves" the data, since we use getDataAsRecordList() to retrieve the data, we only get the unfiltered records rather than all of them. In our use case, we'd like to retrieve ALL the records of the ListGrid, regardless of if they've been filtered out or not.

Our current solution is to clear the filter/criteria prior to any of these actions but this is starting to get tedious.

Preferably I'd like to be able to have the duplicate prevention triggered even on filtered data, and for there to be some method that retrieves all data filtered or not. I notice there are some underlying JavaScript code that can help me achieve this... so that might be the route I'll go down.

But if anyone else has a similar use case to this I'd love to hear some suggestions.

Cheers!

Viewing all articles
Browse latest Browse all 4756

Trending Articles