diff --git a/slick.grid.js b/slick.grid.js index 9c525b003..5e46580cf 100644 --- a/slick.grid.js +++ b/slick.grid.js @@ -598,9 +598,11 @@ if (typeof Slick === "undefined") { $paneHeaderL.width(canvasWidthL); $paneHeaderR.css('left', canvasWidthL); + $paneHeaderR.css('width',viewportW - canvasWidthL); $paneTopL.width(canvasWidthL); $paneTopR.css('left', canvasWidthL); + $paneTopR.css('width',viewportW - canvasWidthL); $headerRowScrollerL.width(canvasWidthL); $headerRowScrollerR.width(viewportW - canvasWidthL); diff --git a/slick.groupitemmetadataprovider.js b/slick.groupitemmetadataprovider.js index a50e6385b..a1d61576c 100644 --- a/slick.groupitemmetadataprovider.js +++ b/slick.groupitemmetadataprovider.js @@ -33,7 +33,8 @@ toggleCssClass: "slick-group-toggle", toggleExpandedCssClass: "expanded", toggleCollapsedCssClass: "collapsed", - enableExpandCollapse: true + enableExpandCollapse: true, + groupColumns: false }; options = $.extend(true, {}, _defaults, options); @@ -108,27 +109,44 @@ } } - function getRowMetadata(item) { - if (options.getRowMetadata) { - return options.getRowMetadata(item); - } + function getGroupRowMetadata(item) { - return null; + var columns = { + 0: { + colspan: "*", + formatter: defaultGroupCellFormatter, + editor: null + } + }; + + if (options.groupColumns && options.groupColumns.length) { + + var columns = options.groupColumns; + + for (var i in columns) { + if (columns[i].hasOwnProperty("formatter")) { + var column = columns[i]; + if (column.formatter == null) { + column.formatter = defaultGroupCellFormatter; + } else { + if (typeof column.formatter == "function") { + column.formatter = column.formatter; + } else if (column.formatter == "empty") { + column.formatter = function () {}; + } else { + delete column.formatter; + } + } + } + } } - function getGroupRowMetadata(item) { - return { - selectable: false, - focusable: options.groupFocusable, - cssClasses: options.groupCssClass, - columns: { - 0: { - colspan: "*", - formatter: defaultGroupCellFormatter, - editor: null - } - } - }; + return { + selectable: false, + focusable: options.groupFocusable, + cssClasses: options.groupCssClass, + columns: columns + }; } function getTotalsRowMetadata(item) {