diff --git a/js/grid.jqueryui.js b/js/grid.jqueryui.js index 6e2b29aee..c2e8b1c1f 100644 --- a/js/grid.jqueryui.js +++ b/js/grid.jqueryui.js @@ -226,7 +226,7 @@ }, j + 1 // start enumeration with the index ); - $(items[iColNotInTheGroup >= items.length ? items.length - 1 : iColNotInTheGroup - 1]) + $(items[iColNotInTheGroup === undefined || iColNotInTheGroup >= items.length ? items.length - 1 : iColNotInTheGroup - 1]) .after(items[indexOfAddedItem]); updateNewColOrder(); }