MyTableGrid is a JavaScript based DataGrid control built on the Prototype library. It allows you to display your data in a simple and flexible way.
Here you can see the definition of the methods provided by the MyTableGrid object and their components.
| Method | Description |
|---|---|
| getCurrentPosition() |
Returns the focus current position
example: tableGrid.getCurrentPosition(); //returns [0,0] |
| getColumnIndex(id) |
Returns the index position for a given column id
parameters: id: Column identificator example:
tableGrid.getColumnIndex('title'); //returns 1
|
| getRow(index) |
Returns the row located at the index position
example: tableGrid.getRow(0);return
{id: '1', title: 'Empire Burlesque', artist: 'Bob Dylan', country: 'EU', company: 'Columbia', price: '10.90', year: '1985'}
|
| getModifiedRows() |
Returns an array containing the modified rows
example: tableGrid.getModifiedRows();for example return
[{id: '1', title: 'Empire Burlesque', artist: 'Bob Dylan', country: 'EU', company: 'Columbia', price: '10.90', year: '1985'}]
if you modify the first row.
|
| getValueAt(x,y) |
Returns the value at position x, y
parameters: x: x coordinate y: y coordinate example: tableGrid.getValueAt(1,2); //returns 'One night only' |
| setValueAt(value, x,y) |
Set a value at position x, y
parameters: x: x coordinate y: y coordinate example:
tableGrid.setValueAt('Hello MyTableGrid',1,2);
|
| clear() |
Reset the status (useful after performing a save operation)
example: tableGrid.clear(); |