Skip to content
Browse files

some more minor bugfixes

  • Loading branch information...
1 parent fe7be6a commit 3ca0479f3070f760a4ef959a421c20482102e121 @timothyswt timothyswt committed Nov 5, 2012
View
4 development/GridWorkBench.html
@@ -6,6 +6,7 @@
<script src="../lib/json2.js" type="text/javascript"></script>
<script src="../lib/knockout-2.2.0.js" type="text/javascript"></script>
<script src="../build/koGrid.debug.js" type="text/javascript"></script>
+ <script src="../plugins/koGrid-reorderable.js" type="text/javascript"></script>
<script src="LargeTestData.js" type="text/javascript"></script>
<link href="../koGrid.css" rel="stylesheet" type="text/css" />
</head>
@@ -78,10 +79,11 @@
pageSize: vm.pageSize,
headerRowHeight: 30,
displayRowIndex: false,
+ plugins: [new kgGridReorderable()]
};
vm.changeColumns = function(){
vm.colDefs([{ field: 'Sku', displayName: 'My Sku', cellClass: 'myCellClass', headerClass: 'myHeaderClass'},
- { field: 'Vendor', displayName: 'Supplier', width: 120, headerGroup: 'test' },
+ { field: 'Vendor', displayName: 'Supplier', width: 120 },
{ field: 'SeasonCode', displayName: 'My SeasonCode', width: 140, cellTemplate: 'myCellTemplate' }]);
}
View
2 src/BindingHandlers/kgHeaderRow.js
@@ -12,7 +12,7 @@
if (hgs) {
hg = hgs[col.headerGroup || i];
}
- cell = new kg.HeaderCell(col, hg ? hgs[hg.rightHeaderGroup] : undefined, grid.resizeOnData);
+ cell = new kg.HeaderCell(col, hg ? hgs[hg.rightHeaderGroup] : undefined, grid);
cell.colIndex = i;
headerRow.headerCells.push(cell);
View
1 src/GridClasses/Column.js
@@ -3,6 +3,7 @@
var minWisOb = ko.isObservable(colDef.minWidth);
var maxWisOb = ko.isObservable(colDef.maxWidth);
+ this.def = colDef;
this.width = ko.observable(colDef.width);
this.widthIsConfigured = false;
this.autoWidthSubscription = undefined;
View
5 src/GridClasses/HeaderCell.js
@@ -1,4 +1,4 @@
-kg.HeaderCell = function (col, rightHeaderGroup, resizeOnDataCallback) {
+kg.HeaderCell = function (col, rightHeaderGroup, grid) {
var self = this;
this.colIndex = col.colIndex;
@@ -77,7 +77,7 @@
}, DELAY);
} else {
clearTimeout(timer); //prevent single-click action
- resizeOnDataCallback(self.column); //perform double-click action
+ grid.resizeOnDataCallback(self.column); //perform double-click action
clicks = 0; //after action performed, reset counter
}
};
@@ -100,6 +100,7 @@
};
setMargins(self.rightHeaderGroup, diff),
self.width(newWidth < self.minWidth() ? self.minWidth() : (newWidth > self.maxWidth() ? self.maxWidth() : newWidth));
+ kg.cssBuilder.buildStyles(grid);
return false;
};
this.gripOnMouseDown = function (event) {

0 comments on commit 3ca0479

Please sign in to comment.
Something went wrong with that request. Please try again.