Using phpgrid.com to create a datagrid. Now i want to add a column named XYZ and with contents as ABC for all rows. Is it possible? The content is static for all rows and wont change at all. The column is not fetched from mysql table.
Asked
Active
Viewed 337 times
1 Answers
3
You need to use virtual column add_column
http://phpgrid.com/example/virtual-column-aka-calculated-column/
$col_formatter = <<<COLFORMATTER
function(cellvalue, options, rowObject){
return "ABC";
}
COLFORMATTER;
$dg -> add_column(
'XYZ',
array('name'=>'XYZ',
'index'=>'XYZ',
'width'=>'360',
'align'=>'left',
'sortable'=>false,
'formatter'=>$col_formatter),
'XYZ');

KSchoniov
- 416
- 4
- 10
-
possible to make content dynamic using mysql table? any reference on it? – Hello Man Mar 01 '15 at 11:38