Hi,
I need some help with the following scenario:
I have a Ticket model, which has Close Date ("Dia Cierre" in spanish) attribute.
I managed to add a column (within Ticket admin view) called "Pending" ("Pendiente" in spanish) who is calculated depending on "Close Date":
-
If Close Date is NULL, Pending is YES.
-
If Close Date is not NULL, Pending is NO.
Now I need to add the filter for Pending column. But I do not know If I’m doing right. I also do not know how to define the search criteria within Ticket model.
Ticket admin view:
...
'columns'=>array(
...
array(
'name'=>'filterPending',
'header'=>'Pending',
'value'=>'Ticket::getIsPending($data->closeDate)',
'filter' => Ticket::getIsPendingFilter(),
),
Ticket model:
public $filterPendiente;
public static $isPending = array('0'=>'YES','1'=>'NO');
public static function getIsPending($key=null)
{
if($key!==null)
return self::$isPending [0];
return self::$isPending [1];
}
public static function getIsPendingFilter()
{
return self::$isPending ;
}