Open SimplGy opened 10 years ago
This is a great point, even if it has sat here for some months. Would the best solution to all this be to modify OnRowsChanged so that it does fire when there are no new rows. I'd have to look at what's involved, but that would seem to make sense.
Modifying onRowsChanged would be a breaking change, but I think it would have been the better design if you're making other sweeping changes/don't mind a breaking change.
Might want to think about rolling in other events like those that change/set columns--one reaction event for anything changing in the grid would have been very useful to us. (eg onChange
fires whenever columns, rows, options, or anything has changed)
True. It's possible to put a 'legacy behaviour' switch or even sub-object into the options. At least that allows for relatively simple (if not drop-in) backwards compatibility.
Sounds reasonable to me. I took a quick look at your repo and I think taking over the maintenance is a great idea. SlickGrid is still the best virtualized grid system I think.
Not something I'm prioritizing anymore. Knock it out of the park :)
Update: should probably trigger onRowsChanged
when you do a dataview.sort
that has different ordering. Obviously has perf implications. Otherwise though, filter and group both throw this event but sort doesn't and you have to special-case it in application code.
dataView provides two events I know of that work for observing changes to the displayed rows:
and
onRowsChanged
is good because it takes a diff and only fires if actual rows have changed. The problem is it doesn't fire if the rows have been changed to 0. This is the case if you're working in a filter at the top of the column and there are no matches.In order to observe when the dataView changes to 0 rows, you need also to watch
onRowCountChanged
. The combination of these two events gets the superset of all changes (I think). You can't watch onlyonRowCountChanged
because if you change a filter in such a way that there are still 3 results, but they are 3 different results, the event will not fire.In order to avoid double-calling whatever code you need to trigger when the data changes, you end up needing to debounce the event combo, so it might come out like this:
This seems like such a common need. Is there a single event I'm missing that notifies when dataView changes?