Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shifting to the left in Chrome and Safari #50

Open
wants to merge 2 commits into
base: 2.0-frozenRowsAndColumns
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions slick.grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
56 changes: 37 additions & 19 deletions slick.groupitemmetadataprovider.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
toggleCssClass: "slick-group-toggle",
toggleExpandedCssClass: "expanded",
toggleCollapsedCssClass: "collapsed",
enableExpandCollapse: true
enableExpandCollapse: true,
groupColumns: false
};

options = $.extend(true, {}, _defaults, options);
Expand Down Expand Up @@ -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) {
Expand Down