|
A simple DataGrid Component.
Screenshots:
Features:
- Column-Based sorting up and down.
- Sorting can be defined as numeric or alpha for each column.
- Data and title can be aligned to the left/center/right.
- The styles can be customized with css files.
- Fixed header feature. Note: not all browsers support that, see compatibility.
- Dynamically add rows at runtime using addRow(). See example 3.
- "rowClick" feature, see example 4.
Example Code:
myGrid = new Bs_DataGrid('myGrid');
myGrid.bHeaderFix = false;
var header = new Array('#', 'Foo', {text:'Bar', align:'right', width:50});
var data = new Array();
data[data.length] = new Array('1', 'asdfasdf', '19');
data[data.length] = new Array('2', 'bbbbbb', '15');
data[data.length] = new Array('3', 'zzzzzz', '111');
data[data.length] = new Array('4', 'dddddd', '183');
myGrid.setHeaderProps(header);
myGrid.setData(data);
myGrid.drawInto('myGridDiv');
Compatibility:
- Tested on Internet Explorer 6: Everything OK.
- Tested on Internet Explorer 5: Using bHeaderFix crashes the browser. Otherwise it's OK.
- Tested on Mozilla 1.5: Everything OK.
- Tested on Opera 7.11: Cannot be sorted up, only down. bHeaderFix does not work.
|
|
|