I’m sure people are getting tired of my GridView questions… haha
Here’s what I want to try next. I want to make GridView render a second row for each item in the DataProvider.
I’m poking around inside the CGridView class and I’m GUESSING I need to override the “renderTableRow” method but wondering if there’s a better way to do this.
Again, I’m using the CArrayDataProvider and the array my data provider is based on is like so:
array(
'id' => ...,
'name' => ....,
// etc...
'secondRow' => array(
// Second row data here
)
);
I’ve thought about going with a purely flat array so that every other row is the special second row but SOME rows won’t have a second row.
And in my widget call in my view:
$this->widget('application.extensions.MyCashViewGrid', array(
'dataProvider' => $dataProvider,
// etc...
'columns' => array(
'number:text:Number',
'type:text:Type',
'cash_date:date:Cash Date',
'cash_amount:money:Cash Amount',
'balance:money:Balance',
array(
'class' => 'MyActionColumn',
'actions' => array(
'Quick Edit',
'Delete'
)
)
),
));
And I’ve got a MyActionColumn class rendering that stuff.
Basically trying to make it so some items have a second row that’s a “quick edit” for the row above it. But not all rows will have it.
Any thoughts?