Removed
This module was replaced with the data table module in this version.
rowSelectableLookup
function to determine whether a row is selectable after it has been clicked and added the ability to disable row selection entirely using the unselectable
property in the row data. page(page)
to set the page. allowHeaderWrap
setting for individual columns using the allowWrap
property. table.options.defaultCompare = function(a, b) {
return a > b ? 1 : -1;
}
table.options.columnCompare['age'] = function(a, b) {
return a > b ? 1 : -1;
}
getSelected
method. // table data
data = {
head : {
columns: [
{value: "Column 1"},
{value: "Column 2"},
{value: "Column 3"}
]
},
body: [
[{value: 1, formatted: "1.0"}, {value: 4, formatted: "4.0"}, {value: 8, formatted: "8.0"}],
[{value: 7, formatted: "7.0"}, {value: 9, formatted: "9.0"}, {value: 3, formatted: "3.0"}],
[{value: 1, formatted: "1.0"}, {value: 8, formatted: "8.0"}, {value: 5, formatted: "5.0"}],
...
]
}
// the table can be instructed to, by default, use the 'value' property of the cell objects for sorting and filtering for:
options.defaultCellValueLookup = function(datum) {
return datum.value;
}
// table data
data = {
head : {
columns: [
{value: "Column 1"},
{value: "Column 2"},
{value: "Column 3"}
]
},
body: [
[{value: 1, formatted: "1.0"}, {value: 4, formatted: "4.0"}, {value: 8, formatted: "8.0"}],
[{value: 7, formatted: "7.0"}, {value: 9, formatted: "9.0"}, {value: 3, formatted: "3.0"}],
[{value: 1, formatted: "1.0"}, {value: 8, formatted: "8.0"}, {value: 5, formatted: "5.0"}],
...
]
}
// the table can be instructed to use the 'value' property of the objects for sorting and filtering for 'Column 1' like this:
options.cellValueLookup = {
'Column 1': function(datum) {
return datum.value;
}
}
// table data
data = {
head : {
columns: [
{value: "Column 1"},
{value: "Column 2"},
{value: "Column 3"}
]
},
body: [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
...
]
}
// The table can be instructed to render values in 'Column 1' like this:
options.cellValueLookup = {
'Column 1': function(datum, element, index) {
return (datum != 1 ? datum + 's' : datum);
}
}