Skip to content
This repository has been archived by the owner on Dec 6, 2017. It is now read-only.

Commit

Permalink
- Removed code supporting the deprecated cell positioning.
Browse files Browse the repository at this point in the history
- Generated an explicit row height for the row CSS class to allow styling the row and fix the odd/even row styling.
  • Loading branch information
mleibman committed Jul 24, 2011
1 parent 0ed544b commit 3f791a2
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions slick.grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -711,19 +711,16 @@ if (typeof Slick === "undefined") {
"." + uid + " .slick-top-panel { height:" + options.topPanelHeight + "px; }",
"." + uid + " .slick-headerrow-columns { height:" + options.headerRowHeight + "px; }",
"." + uid + " .slick-cell { height:" + rowHeight + "px; }",
"." + uid + " .slick-row { width:" + getRowWidth() + "px; }",
"." + uid + " .slick-row { width:" + getRowWidth() + "px; height:" + options.rowHeight + "px; }",
"." + uid + " .lr { float:none; position:absolute; }"
];

var rowWidth = getRowWidth();
var x = 0, w;
for (var i=0; i<columns.length; i++) {
w = columns[i].width;

rules.push("." + uid + " .l" + i + " { left: " + x + "px; }");
rules.push("." + uid + " .r" + i + " { right: " + (rowWidth - x - w) + "px; }");
rules.push("." + uid + " .c" + i + " { width:" + (w - cellWidthDiff) + "px; }");

x += columns[i].width;
}

Expand Down Expand Up @@ -873,9 +870,6 @@ if (typeof Slick === "undefined") {
for (var i = 0; i < columns.length; i++) {
w = columns[i].width;

rule = findCssRule("." + uid + " .c" + i);
rule.style.width = (w - cellWidthDiff) + "px";

rule = findCssRule("." + uid + " .l" + i);
rule.style.left = x + "px";

Expand Down Expand Up @@ -1094,14 +1088,7 @@ if (typeof Slick === "undefined") {
for (var i=0, cols=columns.length; i<cols; i++) {
var m = columns[i];
colspan = getColspan(row, i); // TODO: don't calc unless we have to

if (true || rowHasColumnData) {
cellCss = "slick-cell lr l" + i + " r" + Math.min(columns.length -1, i + colspan - 1) + (m.cssClass ? " " + m.cssClass : "");
}
else {
cellCss = "slick-cell c" + i + (m.cssClass ? " " + m.cssClass : "");
}

cellCss = "slick-cell lr l" + i + " r" + Math.min(columns.length -1, i + colspan - 1) + (m.cssClass ? " " + m.cssClass : "");
if (row === activeRow && i === activeCell) {
cellCss += (" active");
}
Expand Down

0 comments on commit 3f791a2

Please sign in to comment.