ROW ID Question
ROW ID Question
lyndonwil
Posts: 40Questions: 5Answers: 0
I have a ID field and i'd like it to be the first column in the table. I'd also like it to be the ROW ID
To get the ID field in the first column, I do this :
array( 'db' => 'enquiryid', 'dt' => 0,
'formatter' => function( $d, $row ) {
return number_format($d);
}
)
To get the ROW ID, i do this :
array('db' => 'enquiryid','dt' => 'DT_RowId',
'formatter' => function( $d, $row ) {
return 'row_'.$d;
}
)
My question is, how can I do both at the same time as I need the ID field to be shown in the first column. I.e. 1, 2,3 etc.. and I need the Row Id in the TR. I.e. Row_1, Row_2 etc..
Lynd
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You could use
createdRow
to add the row. Or if you need to use the SSP class, you could loop over the data before it is sent back and copy it from over variable to another. Finally, you could usedata: 'DT_RowId'
for the first column.Allan
Thanks Allan, thats great :-)