Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Pagination with hidden records

    I'm using several ListGrids with pagination turned on, and regular filters and sorts work fine. The problem is that I need to do further checks on the server to determine whether the current user is allowed to see each row in the query results. Is there a recommended strategy for handing pagination in the ListGrid when the server may remove/hide individual record(s) from a query?

    Right now I seem to be able to:

    1) Send back an empty/placeholder record for each one that the user shouldn't see. Extra rows with empty content don't look very good for the user.
    2) Completely remove the hidden records from the data, which looks fine but causes startRow/endRow to get out of sync between client/server.

    The datasets may be large, where it wouldn't be easy to get a complete dataset up front instead of paging through it.

    Thanks for any assistance.


    SmartGWT v9.0p_2013-08-02/LGPL Development Only (built 2013-08-02), using Chrome

    #2
    The simplest thing to do, if it's feasible, it to express the rules that eliminate records as criteria on the DSRequest. Server-side code in a DMI can add the criteria to an inbound DSRequest and then execute() it normally. The client need not be aware of the criteria and there is no need to map between rowNums.

    Aside from that, your first strategy (blank rows) can be a positive thing in some apps, if the rows are not entirely blank and instead show partial information. This might be acceptable if it's not important from a security perspective that the user is completely unaware of the record, or if there's in fact some positive value in the user being aware of records they can't fully view.

    If none of the above are feasible, you do need to implement a moderately complicated algorithm to keep track of the offset created by missing and modify startRow/endRow to avoid issues. Isomorphic has implemented this before but not wrapped it up as a feature - consider Feature Sponsorship if you want this capability built for you as a framework feature.

    Comment

    Working...
    X