Skip to content

Commit

Permalink
feat: add new event onBeforeSetColumns (#625)
Browse files Browse the repository at this point in the history
- for my use case, I need to execute some logic before the header menu are re-rendered by the `setColumns`
  • Loading branch information
ghiscoding authored Aug 28, 2021
1 parent beef51f commit 9c3ce51
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions slick.grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -2877,6 +2877,8 @@ if (typeof Slick === "undefined") {
}

function setColumns(columnDefinitions) {
trigger(self.onBeforeSetColumns, { previousColumns: columns, newColumns: columnDefinitions, grid: self });

var _treeColumns = new Slick.TreeColumns(columnDefinitions);
if (_treeColumns.hasDepth()) {
treeColumns = _treeColumns;
Expand Down Expand Up @@ -5960,6 +5962,7 @@ if (typeof Slick === "undefined") {
"onSelectedRowsChanged": new Slick.Event(),
"onCellCssStylesChanged": new Slick.Event(),
"onAutosizeColumns": new Slick.Event(),
"onBeforeSetColumns": new Slick.Event(),
"onRendered": new Slick.Event(),
"onSetOptions": new Slick.Event(),

Expand Down

0 comments on commit 9c3ce51

Please sign in to comment.