Individual cell formating

A place for users and developers of the Xataface to discuss and receive support.

Individual cell formating

Postby Gwynnbleid1 » Mon Oct 22, 2012 12:43 am

Hi.

Is it possible to format single cell (like change font color) ? I found this funciton css__tableRowClass and also this http://xataface.com/wiki/Customizing_th ... _or_a_cell but I couldn't find example for single cell situation.
Please help !
Gwynnbleid1
 
Posts: 31
Joined: Thu Sep 20, 2012 3:02 pm

Re: Individual cell formating

Postby silma » Mon Oct 22, 2012 1:59 am

Look for the "renderCell " section there :
http://xataface.com/documentation/how-to/list_tab
silma
 
Posts: 87
Joined: Tue Apr 28, 2009 11:47 pm

Re: Individual cell formating

Postby Gwynnbleid1 » Mon Oct 22, 2012 2:54 am

silma wrote:Look for the "renderCell " section there :
http://xataface.com/documentation/how-to/list_tab

Thanks for suggestion. I ended with something like this:
Code: Select all
      function SuspensionWear__renderCell(&$record)
      {
         if ( $record->val('SuspensionWear2') == 99 ) return '<div style="color:red;font-weight:bold;display: table-cell;">'.$record->strval('SuspensionWear').'</div>';
         else
         return $record->strval('SuspensionWear');
      }


It works well but I need to add red font color for some other fields, so function above is repeated several times for other fields. Is it possible to add a function like this :
Code: Select all
      static function GedRedVal($val)
      {
         return '<div style="color:red;font-weight:bold;display: table-cell;">'.$val.'</div>';
      }

and use it in function renderCell ? I tried it but received an error.
Gwynnbleid1
 
Posts: 31
Joined: Thu Sep 20, 2012 3:02 pm

Re: Individual cell formating

Postby silma » Tue Oct 23, 2012 12:22 am

What about a css class ?
For a rendering, it would be more adequate than a function.
silma
 
Posts: 87
Joined: Tue Apr 28, 2009 11:47 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved