jQWidgets Forums

jQuery UI Widgets Forums Grid Refresh cellclass on filter matching rows?

This topic contains 2 replies, has 2 voices, and was last updated by  admin 1 year, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • Bungle1981
    Participant

    Hi all, I have a cellclass function, similar to below, that helps to style cells within the grid:

    function cellclass(row, columnfield, value, data) {
        if (mode === 'User Activity') {
            if (data.giuActivity === 'Sign On') { return 'green'; };
        } else {
            return row % 2 === 0? null : 'grey';
        }   
    } 

    My issue is with the intent behind return row % 2 === 0? null : 'grey';.

    When I apply filters, from DOM inspection I can see that the other rows are still ‘there’, just hidden somehow so the cellclass is retained and the alternate class isn’t ‘refreshed’ and applied within the context of the filtered rows.

    Is there a way of having the intent behind ‘return row % 2 === 0? null : ‘grey’ still function on filtered rows?

    I should also say, I have tried using the altrows property to achieve this but it never seems to do anything and the desired behaviour isn’t as straightforward as always applying alternate rows.


    Bungle1981
    Participant

    I found a way of doing this so the alternate row class is always set correctly regardless of filter, so commenting in case someone else has this issue in the future.

    I solved by changing return row % 2 === 0? null : 'grey'; to return data.boundindex % 2 === 0? null : 'grey';


    admin
    Keymaster

    Thanks for the update

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.