Posted 14 September 2017, 12:07 pm EST
I need to add different style classes in different scenario in wijimo grid. and need to change width of column.
In our case grid is generated dynamically. Can you suggest way to add dynamic classes?
Thanks
Forums Home / Wijmo / General Discussion
Posted by: nilesh_nichal on 14 September 2017, 12:07 pm EST
Posted 14 September 2017, 12:07 pm EST
I need to add different style classes in different scenario in wijimo grid. and need to change width of column.
In our case grid is generated dynamically. Can you suggest way to add dynamic classes?
Thanks
Posted 14 September 2017, 12:07 pm EST
Hello Nilesh,
You can add class dynamically as follows:
If you would like to add class for Cell, you need to add class using itemFormatter’s cell property. Please use the following code snippet for the same:
grid.itemFormatter=function(panel,r,c,cell){
if(wijmo.grid.CellType.Cell==panel.cellType && r=2 && c==2){
// add class here using cell that is a HTML element
}
}
If you would like to add class for a row/column, you can add class using cssClass property of Row/Column class. Please use the following code snippet for the same:
grid.rows[rowIndex].cssClass='classname';
grid.columns[colIndex].cssClass='classname';
Please add classes for row and columns in the initialzied or loadedRows event.
You can change any column width using width property of Column class. Please use the following code snippet for the same:
grid.columns[colIndex].width= 150; //width of column should be in number
Thanks,
Manish Kumar Gupta
Posted 12 December 2017, 3:42 am EST
Can we make the width dynamic. I dont want it to be fixed