slickgrid
Advanced tools
Comparing version 2.4.17 to 2.4.18
@@ -67,2 +67,10 @@ /*** | ||
* The plugin exposes the following events: | ||
* | ||
* onAfterMenuShow: Fired after the menu is shown. You can customize the menu or dismiss it by returning false. | ||
* * ONLY works with a jQuery event (as per slick.core code), so we cannot notify when it's a button event (when grid menu is attached to an external button, not the hamburger menu) | ||
* Event args: | ||
* grid: Reference to the grid. | ||
* column: Column definition. | ||
* menu: Menu options. Note that you can change the menu items here. | ||
* | ||
* onBeforeMenuShow: Fired before the menu is shown. You can customize the menu or dismiss it by returning false. | ||
@@ -193,2 +201,3 @@ * * ONLY works with a jQuery event (as per slick.core code), so we cannot notify when it's a button event (when grid menu is attached to an external button, not the hamburger menu) | ||
function destroy() { | ||
_self.onAfterMenuShow.unsubscribe(); | ||
_self.onBeforeMenuShow.unsubscribe(); | ||
@@ -326,3 +335,2 @@ _self.onMenuClose.unsubscribe(); | ||
if (typeof e.isPropagationStopped === "function") { | ||
if (_self.onBeforeMenuShow.notify(callbackArgs, e, _self) == false) { | ||
@@ -385,2 +393,8 @@ return; | ||
_isMenuOpen = true; | ||
if (typeof e.isPropagationStopped === "function") { | ||
if (_self.onAfterMenuShow.notify(callbackArgs, e, _self) == false) { | ||
return; | ||
} | ||
} | ||
} | ||
@@ -554,2 +568,3 @@ | ||
"onAfterMenuShow": new Slick.Event(), | ||
"onBeforeMenuShow": new Slick.Event(), | ||
@@ -556,0 +571,0 @@ "onMenuClose": new Slick.Event(), |
{ | ||
"name": "slickgrid", | ||
"version": "2.4.17", | ||
"version": "2.4.18", | ||
"description": "A lightning fast JavaScript grid/spreadsheet", | ||
@@ -37,6 +37,6 @@ "main": "slick.core.js", | ||
"devDependencies": { | ||
"cypress": "^3.8.0", | ||
"eslint": "^6.7.2", | ||
"http-server": "^0.12.0" | ||
"cypress": "^3.8.3", | ||
"eslint": "^6.8.0", | ||
"http-server": "^0.12.1" | ||
} | ||
} |
@@ -87,2 +87,8 @@ (function ($) { | ||
* | ||
* onAfterMenuShow: Fired after the menu is shown. You can customize the menu or dismiss it by returning false. | ||
* Event args: | ||
* cell: Cell or column index | ||
* row: Row index | ||
* grid: Reference to the grid. | ||
* | ||
* onBeforeMenuShow: Fired before the menu is shown. You can customize the menu or dismiss it by returning false. | ||
@@ -165,2 +171,3 @@ * Event args: | ||
function destroy() { | ||
_self.onAfterMenuShow.unsubscribe(); | ||
_self.onBeforeMenuShow.unsubscribe(); | ||
@@ -249,2 +256,10 @@ _self.onBeforeMenuClose.unsubscribe(); | ||
if (_self.onAfterMenuShow.notify({ | ||
"cell": _currentCell, | ||
"row": _currentRow, | ||
"grid": _grid | ||
}, e, _self) == false) { | ||
return; | ||
} | ||
return menu; | ||
@@ -272,6 +287,16 @@ } | ||
function destroyMenu() { | ||
function destroyMenu(e, args) { | ||
$menu = $menu || $(".slick-cell-menu." + _gridUid); | ||
if ($menu && $menu.remove) { | ||
if ($menu.length > 0) { | ||
if (_self.onBeforeMenuClose.notify({ | ||
"cell": args && args.cell, | ||
"row": args && args.row, | ||
"grid": _grid, | ||
"menu": $menu | ||
}, e, _self) == false) { | ||
return; | ||
} | ||
} | ||
$menu.remove(); | ||
@@ -642,2 +667,3 @@ $menu = null; | ||
"onAfterMenuShow": new Slick.Event(), | ||
"onBeforeMenuShow": new Slick.Event(), | ||
@@ -644,0 +670,0 @@ "onBeforeMenuClose": new Slick.Event(), |
@@ -93,2 +93,8 @@ (function ($) { | ||
* | ||
* onAfterMenuShow: Fired after the menu is shown. You can customize the menu or dismiss it by returning false. | ||
* Event args: | ||
* cell: Cell or column index | ||
* row: Row index | ||
* grid: Reference to the grid. | ||
* | ||
* onBeforeMenuShow: Fired before the menu is shown. You can customize the menu or dismiss it by returning false. | ||
@@ -182,2 +188,3 @@ * Event args: | ||
function destroy() { | ||
_self.onAfterMenuShow.unsubscribe(); | ||
_self.onBeforeMenuShow.unsubscribe(); | ||
@@ -268,2 +275,10 @@ _self.onBeforeMenuClose.unsubscribe(); | ||
if (_self.onAfterMenuShow.notify({ | ||
"cell": _currentCell, | ||
"row": _currentRow, | ||
"grid": _grid | ||
}, e, _self) == false) { | ||
return; | ||
} | ||
return menu; | ||
@@ -663,2 +678,3 @@ } | ||
"onAfterMenuShow": new Slick.Event(), | ||
"onBeforeMenuShow": new Slick.Event(), | ||
@@ -665,0 +681,0 @@ "onBeforeMenuClose": new Slick.Event(), |
@@ -67,2 +67,9 @@ (function ($) { | ||
* The plugin exposes the following events: | ||
* onAfterMenuShow: Fired after the menu is shown. You can customize the menu or dismiss it by returning false. | ||
* Event args: | ||
* grid: Reference to the grid. | ||
* column: Column definition. | ||
* menu: Menu options. Note that you can change the menu items here. | ||
* | ||
* onBeforeMenuShow: Fired before the menu is shown. You can customize the menu or dismiss it by returning false. | ||
@@ -298,2 +305,6 @@ * Event args: | ||
if (_self.onAfterMenuShow.notify(callbackArgs, e, _self) == false) { | ||
return; | ||
} | ||
// Stop propagation so that it doesn't register as a header click event. | ||
@@ -355,2 +366,3 @@ e.preventDefault(); | ||
"onAfterMenuShow": new Slick.Event(), | ||
"onBeforeMenuShow": new Slick.Event(), | ||
@@ -357,0 +369,0 @@ "onCommand": new Slick.Event() |
@@ -85,2 +85,3 @@ (function ($) { | ||
var onRowsOrCountChanged = new Slick.Event(); | ||
var onBeforePagingInfoChanged = new Slick.Event(); | ||
var onPagingInfoChanged = new Slick.Event(); | ||
@@ -151,2 +152,4 @@ | ||
function setPagingOptions(args) { | ||
onBeforePagingInfoChanged.notify(getPagingInfo(), null, self); | ||
if (args.pageSize != undefined) { | ||
@@ -986,2 +989,4 @@ pagesize = args.pageSize; | ||
var previousPagingInfo = $.extend(true, {}, getPagingInfo()); | ||
var countBefore = rows.length; | ||
@@ -1004,2 +1009,3 @@ var totalRowsBefore = totalRows; | ||
if (totalRowsBefore !== totalRows) { | ||
onBeforePagingInfoChanged.notify(previousPagingInfo, null, self); // use the previously saved paging info | ||
onPagingInfoChanged.notify(getPagingInfo(), null, self); | ||
@@ -1128,3 +1134,3 @@ } | ||
} else { | ||
grid.onCellCssStylesChanged.unsubscribe(styleChanged); | ||
grid.onCellCssStylesChanged.unsubscribe(); | ||
self.onRowsOrCountChanged.unsubscribe(update); | ||
@@ -1191,2 +1197,3 @@ } | ||
"onRowsOrCountChanged": onRowsOrCountChanged, | ||
"onBeforePagingInfoChanged": onBeforePagingInfoChanged, | ||
"onPagingInfoChanged": onPagingInfoChanged | ||
@@ -1193,0 +1200,0 @@ }); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4404987
97093