rkj
rkj

Reputation: 541

Slickgrid CollapseExpand Not working

I'm using the slickgrid example 5 for collapsing(this one)

I've implemented this feature for my project but the collapse and expand icons have stopped working, like nothing is happening when i'm clicking on the collapse or expand button. Rows/Child rows stay as they are rendered. I tried to look into the code in order to find any events are bounded but couldn't.

So do I've to implement custom events to handle expand/collapse?

Any reference would also be helpful.

Upvotes: 0

Views: 620

Answers (1)

kiwi1342
kiwi1342

Reputation: 1389

Usually it happens when the filter has not been setup on dataView or the dataView change events are missing:

So first make sure the dataView has a filter setup:

dataView.setFilter(myFilter);

and then don't forget the listeners

// Make the grid respond to DataView change events.
dataView.onRowCountChanged.subscribe(function (e, args) {
  grid.updateRowCount();
  grid.render();
});

dataView.onRowsChanged.subscribe(function (e, args) {
  grid.invalidateRows(args.rows);
  grid.render();
});

Upvotes: 0

Related Questions