-
Notifications
You must be signed in to change notification settings - Fork 295
ColumnSet
bitpshr edited this page Jan 25, 2013
·
9 revisions
The ColumnSet module provides functionality which divides a grid's columns into multiple distinct sets, each of which manage their columns' horizontal scrolling independently. This makes it possible to keep certain columns in view even while others are scrolled out of viewing range. When mixing in ColumnSet, instead of specifying columns
or subRows
, one specifies columnSets
, which is essentially an array of subRows
. For example, in pseudocode:
var grid = new (declare([Grid, ColumnSet]))({
columnSets: [
// left columnset
[
[
{ /* columnset 1, subrow 1, column 1 */ },
{ /* columnset 1, subrow 1, column 2 */ }
],
[
{ /* columnset 1, subrow 2, column 1 */ },
{ /* columnset 1, subrow 2, column 2 */ }
]
],
// right columnset
[
[
{ /* columnset 2, subrow 1, column 1 */ },
{ /* columnset 2, subrow 1, column 2 */ }
],
[
{ /* columnset 2, subrow 2, column 1 */ },
{ /* columnset 2, subrow 2, column 2 */ }
]
]
],
...
}, "grid");
More concrete examples of ColumnSet usage can be found in the complex_column.html
test page.
The ColumnSet mixin defines the following additional instance method:
Method | Description |
---|---|
styleColumnSet(columnsetId, css) |
Programmatically adds styles to a columnset, by injecting a rule into a stylesheet in the document. Returns a handle with a remove function, which can be called to later remove the added style rule. |