Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.
teleological edited this page Mar 4, 2012 · 2 revisions

Slickback.CollectionEventsMixin (included by Slickback.PaginatedCollection) implements the event publish/subscribe API used by Slick.Data.Dataview for the following SlickGrid events:

  • onPagingInfoChanged
  • onRowCountChanged
  • onRowsChanged

This enables a collection to be used with Slick.Controls.Pager, which subscribes to onPagingInfoChanged notifications.

Slickback.EventTranslationMixin (also included by Slickback.PaginatedCollection) republishes the following Backbone.Collection events as SlickGrid events:

  • reset
  • add
  • remove

This makes it possible to follow the SlickGrid examples in using SlickGrid events to drive grid rendering:

collection.onRowCountChanged.subscribe(function() {
  grid.updateRowCount();
  grid.render();
});

collection.onRowsChanged.subscribe(function() {
  grid.invalidateAllRows();
  grid.render();
});

Note than unlike in Slick.Data.DataView, these events do not include parameters describing the state of the collection before the change.

Clone this wiki locally