renderCell function causes Find problem
Posted: Thu Apr 21, 2011 2:56 pm
I want to display an amount field right-aligned in its column in list view. I tried the following, but it had no impact on the alignment:
Then i tried using the renderCell method as follows, which did not align the field values in the column properly:
The only way that I could align them was to use this code:
Two problems resulted: (1) the link functionality was lost, and (2) when I then clicked the Find tab, selected criteria from any column, and clicked FInd, I received a blank page, namely the application's index.php.
So, how do I right-align any numeric value field in list view and why did the renderRow method affect the Find adversely?
- Code: Select all
class tables_Tips {
function TipAmount__display(&$record){
return str_pad(number_format($record->val('TipAmount'), 2, '.', ','), 12, " ", STR_PAD_LEFT);
}
}
Then i tried using the renderCell method as follows, which did not align the field values in the column properly:
- Code: Select all
class tables_Tips {
function TipAmount__renderCell( &$record ){
return number_format($record->val('TipAmount'), 2, '.', ',');
}
}
The only way that I could align them was to use this code:
- Code: Select all
class tables_Tips {
function renderRow( &$record ){
return '<td>'.$record->display('MeetingDate').'</td>'.
'<td>'.$record->display('TipFrom').'</td>'.
'<td>'.$record->display('TipTo').'</td>'.
'<td>'.$record->display('TipType').'</td>'.
'<td style="text-align: right;">'.$record->val('TipAmount').'</td>'.
'<td>'.$record->display('TipDescription').'</td>';
}
}
Two problems resulted: (1) the link functionality was lost, and (2) when I then clicked the Find tab, selected criteria from any column, and clicked FInd, I received a blank page, namely the application's index.php.
So, how do I right-align any numeric value field in list view and why did the renderRow method affect the Find adversely?