indicates whether a checkbox or a radio button is checked
Returns:
mygrid.cells("row1",1).isChecked();
indicates whether the specified cell is disabled by the method setDisabled(). If the setDisabled() method wasn't called for the cell, the method returns 'undefined'.
Returns:
mygrid.cells("row1",4).setDisabled(true);
...
mygrid.cells("row1",4).isDisabled(); // ->true
checks whether the specified cell has a certain attribute
Parameters:
mygrid.cells("row1",1).setAttribute('invalid', true);
...
mygrid.cells("row1",1).getAttribute('invalid'); // -> true
gets the background color of the cell set by the method setBgColor. If setBgColor() wasn't called for the cell, the method returns ”#FFFFFF”.
Returns:
//colors the cell in red in 2 different ways
mygrid.cells("row1",1).setBgColor('red');
mygrid.cells("row1",3).setBgColor('#ff0000');
...
mygrid.cells("row1",1).getBgColor(); // -> "red"
mygrid.cells("row1",3).getBgColor(); // -> "#ff0000"
returns dhtmlXCombo cell object that can be used to work with dhtmlxCombo API
Returns:
//getting dhtmlXCombo cell object
myCombo = grid.cells(id,index).getCellCombo();
//using it later with dhtmlxCombo API
myCombo.addOption(key,text);
retrieves the horizontal alignment set in the cell by the method setHorAlign. If setHorAlign() wasn't called for the cell, the method returns “left”.
Returns:
mygrid.cells("row1",1).setHorAlign('right');
...
mygrid.cells("row1",1).getHorAlign(); // -> "right"
gets the math formula specified for the cell. If no formulas are specified for the cell, the method returns the plain cell value.
Returns:
mygrid.cells("row1",2).getMathValue(); // returns the value like "=c2*c3"
gets the text color of the cell set by the method setTextColor. If setTextColor wasn't called for the cell, the method returns ”#000000”.
Returns:
//colors the cell in red in 3 different ways
mygrid.cells("row1",1).setTextColor('red');
mygrid.cells("row1",2).setTextColor('rgb(255,0,0)');
mygrid.cells("row1",3).setTextColor('#ff0000');
...
mygrid.cells("row1",1).getTextColor(); // -> "red"
mygrid.cells("row1",2).getTextColor(); // -> "rgb(255,0,0)"
mygrid.cells("row1",3).getTextColor(); // -> "rgb(255,0,0)"
gets the value of the specified cell as it's displayed in the grid
Returns:
mygrid.cells("row1",3).getTitle(); // ->"$12.99"
mygrid.cells("row1",3).getValue(); // ->"12.99"
gets the value of the specified cell
Returns:
mygrid.cells("row1",3).getValue(); // ->"12.99"
gets the width of the cell in pixels
Returns:
mygrid.cells("row1",3).getWidth();
sets a custom attribute (flag) for the specified cell
Parameters:
mygrid.cells("row1",1).setAttribute('invalid', true);
...
mygrid.cells("row1",1).getAttribute('invalid'); // -> true
sets the background color for the cell
Parameters:
value - (string) the color's value
Can be specified as:
mygrid.cells("row1",1).setBgColor('red'); // Predefined/Cross-browser color name
mygrid.cells("row1",3).setBgColor('#ff0000'); //Hexadecimal color
disables/enables the cell
Parameters:
mygrid.cells("row1",2).setDisabled(true);
sets the horizontal alignment in the cell
Parameters:
value - (string) the horizontal alignment
Possible values are:
mygrid.cells("row1",1).setHorAlign('r');
sets the text color for the cell
Parameters:
value - (string) the color value
Can be specified as:
mygrid.cells("row1",1).setTextColor('red'); // Predefined/Cross-browser color name
mygrid.cells("row1",3).setTextColor('#ff0000'); // Hexadecimal color
mygrid.cells("row1",2).setTextColor('rgb(255,0,0)'); // RGB color
sets the value for the specified cell
Parameters:
mygrid.cells("row1",0).setValue("newValue");
Back to top