diff --git a/controls/slick.pager.js b/controls/slick.pager.js index 243b6602..348d0313 100644 --- a/controls/slick.pager.js +++ b/controls/slick.pager.js @@ -108,6 +108,7 @@ function constructPagerUI() { // the container might be a string, a jQuery object or a native element const container = getContainerElement(selectorOrElm); + if (!container || (container.jquery && !container[0])) return; const navElm = document.createElement('span'); navElm.className = 'slick-pager-nav'; @@ -195,6 +196,7 @@ } function updatePager(pagingInfo) { + if (!container || (container.jquery && !container[0])) return; let state = getNavState(); // remove disabled class on all icons diff --git a/examples/example-grid-menu.html b/examples/example-grid-menu.html index 9e89e074..14290be5 100644 --- a/examples/example-grid-menu.html +++ b/examples/example-grid-menu.html @@ -247,7 +247,7 @@

View Source:

}; // show 1st column with font-awesome hashtag icon - var columns = [{ id: 'id', field: 'id', name: '', width: 40, excludeFromGridMenu: true }]; + var columns = [{ id: 'id', field: 'id', name: '', width: 40, excludeFromGridMenu: true }]; var columnFilters = {}; var sortcol = "id"; var sortdir = 1; diff --git a/examples/example10-async-post-render.html b/examples/example10-async-post-render.html index 59b878cf..995f40ab 100644 --- a/examples/example10-async-post-render.html +++ b/examples/example10-async-post-render.html @@ -61,7 +61,8 @@

View Source:

- + + diff --git a/slick.grid.js b/slick.grid.js index 1fd3138a..0c7d842b 100644 --- a/slick.grid.js +++ b/slick.grid.js @@ -2977,7 +2977,8 @@ if (typeof Slick === "undefined") { _headers.forEach(function (header) { for (let i = 0; i < header.children.length; i++, columnIndex++) { const h = header.children[i]; - const width = columns[columnIndex].width - headerColumnWidthDiff; + const col = columns[columnIndex] || {}; + const width = (col.width || 0) - headerColumnWidthDiff; if (utils.width(h) !== width) { utils.width(h, width); } diff --git a/slick.interactions.js b/slick.interactions.js index 5ab0a0b6..67eb188a 100644 --- a/slick.interactions.js +++ b/slick.interactions.js @@ -39,7 +39,7 @@ }; if (containerElement) { - containerElement.addEventListener('mousedown', userPressed); + containerElement.addEventListener('mousedown', userPressed, Slick.Utils.enablePassiveWhenSupported()); containerElement.addEventListener('touchstart', userPressed, Slick.Utils.enablePassiveWhenSupported()); } @@ -51,7 +51,7 @@ function destroy() { if (containerElement) { - containerElement.removeEventListener('mousedown', userPressed); + containerElement.removeEventListener('mousedown', userPressed, Slick.Utils.enablePassiveWhenSupported()); containerElement.removeEventListener('touchstart', userPressed, Slick.Utils.enablePassiveWhenSupported()); } } @@ -130,13 +130,13 @@ let { element, onMouseWheel } = options; function destroy() { - element.removeEventListener('wheel', wheelHandler, Slick.Utils.enablePassiveWhenSupported()); - element.removeEventListener('mousewheel', wheelHandler, Slick.Utils.enablePassiveWhenSupported()); + element.removeEventListener('wheel', wheelHandler); + element.removeEventListener('mousewheel', wheelHandler); } function init() { - element.addEventListener('wheel', wheelHandler, Slick.Utils.enablePassiveWhenSupported()); - element.addEventListener('mousewheel', wheelHandler, Slick.Utils.enablePassiveWhenSupported()); + element.addEventListener('wheel', wheelHandler); + element.addEventListener('mousewheel', wheelHandler); } // copy over the same event handler code used in jquery.mousewheel