Hi all,
Trying to colour up some rows.
Let's say that we have the following has_many relation between employer and employee.
I want to show a has many table with all the employees and colour up those who are employed by the employer which we are working with in the CMS
Can anyone help me with this code?
class employee exteds DataObject {
$has_one = array (
'MyEmployer' => 'EmployerPage'
)
}
class EmployerPage exteds Page {
$has_many = array (
'Employees' => 'Employee'
)
$MyTable = new HasManyComplexTableField(
$this,
'Employees',
'Employee',
array(
'Name' => 'Name_label',
),
'getCMSFields_forPopup'
);
//Hightlighting
$MyTable ->setHighlightConditions(array(
array(
'rule' => '$this->ID == $MyEmployerID', //think the problem is that $this->ID don't gets the proper value when evaluated ?¿?¿
'class' => 'orange'
)
));
}
Thanks a lot.