Hi,
I have a grid where two columns: participantTotal and ServiceType.name are defined in relations method:
public function relations()
{ return array( …
‘participantTotal’=>array(self::STAT, ‘Participant’,‘ParticipantServices(ServiceId, ParticipantId)’),
‘ServiceType’ => array(self::BELONGS_TO, ‘Service’, ‘UAHLServiceTypeId’),
)}
grid:
<?php $this->widget(‘zii.widgets.grid.CGridView’, array(
'id'=>'service-grid',
'dataProvider'=>$model->search(),
'columns'=>array(
array('name'=>'type', 'header'=>'Service Type', 'value'=>'$data->ServiceType->name'),
'ServiceDate',
array('name'=>'participantTotal','value'=>'$data->participantTotal'),
array('name'=>'NumberOfGuests', 'value'=>'$data->NumberOfGuests'),
array(
'class'=>'CButtonColumn',
),
),
)); ?>
How should I define $sort to sort these two columns?
Thank you very much in advance. Respond time on this forum is phenomenal!
Regards,
Jerzy