Skip to content

SlickGrid v2.3.1

Compare
Choose a tag to compare
@6pac 6pac released this 19 Aug 08:07
· 1064 commits to master since this release

New features/improvements

  • fix for DataView paging issue [https://github.com//issues/43]
  • fix for Grid paging issue related to conflict of paging requirements and enableAddRow
  • example4-model.html modified to remove the slightly hackish:
    dataView.onPagingInfoChanged.subscribe(function (e, pagingInfo) {
      var isLastPage = pagingInfo.pageNum == pagingInfo.totalPages - 1;
      var enableAddRow = isLastPage || pagingInfo.pageSize == 0;
      var options = grid.getOptions();

      if (options.enableAddRow != enableAddRow) {
        grid.setOptions({enableAddRow: enableAddRow});
      }
    });

and replace with

    dataView.onPagingInfoChanged.subscribe(function (e, pagingInfo) {
      grid.updatePagingStatusFromView( pagingInfo );
    });

The grid now stores very minimal information about paging (and provides updatePagingStatusFromView to update it), so it can make decisions without having to turn the enableAddRow option on and off while paging occurs. This breaks separation of concerns very slightly, but the original code is not only brute force, but also forces enableAddRow to be true whenever paging is activated.

When updatePagingStatusFromView is not used, then grid falls back to the previous behaviour (with the 'new row' bug fixed), so this is not a breaking change.