0
votes

Hello I am using Slick Grid with dataview to render , groupby and filter rows.

I am looking for a solution where I can pick an Value like "foo" and highlight reach row with it.

H* is a highlighter row

    header1  header2
------------------------
 H  foo     test
    other   row
    here    andthere
 H  foo     appeared
    again   test
 H  foo     last

Using a compare algorithm I can highlight those rows using Grid.setCellCssStyles

But if I happen to sort by Header1

    header1  header2
------------------------
 H  foo     test
    foo     appeared
    foo     last
 H  other   row
    here    andthere
 H  again   test

As you can see the rows 1,4 and 6 stay highlighter but are incorrect.

Any dynamic solutions?

1

1 Answers

0
votes

Solution I ended up using:

Dataview has a helper function that subscribes to on onRowsChanged , onRowCountChanged and onSelectedRowsChanged to update Selected rows

dataview.syncGridSelection(this.grid,true);

For custom/dynamic CSS highlighting of rows I used their syncGridCellCssStyles helper function.

var obj={};
var row=rowidthat should be highlighted;
obj[row]={column1:"css_class",
        column2:"css_class",
        column3:"css_class"}

this.grid.setCellCssStyles("css_key",obj);

Synchronizing selection and cell CSS