I have just uploaded the Array Data Provider Extension.
It is a data provider (CDataProvider) for array data with paging and sorting support for use in (for example) CGridView.
There is a demo in the package.
I have just uploaded the Array Data Provider Extension.
It is a data provider (CDataProvider) for array data with paging and sorting support for use in (for example) CGridView.
There is a demo in the package.
Awesome extension.
I am getting an issue on sorting the column by clicking the column headers though.
an alert pops up when I try to sort the grid…
— Parameter 2 to array_multisort() exprected to be a reference, value given —
Even the demo fires this off.
Again, great extension. I was doing my own array_multisorts and such. It’s nice to have this stuff working inside a CGridView.
Thanks for this - revised version uploaded.
I did this using PHP 5.2, which worked of course , and it seems PHP 5.3 requires all attributes as references.
public function resolveLabel($attribute) {} may wrong.
CModel::generateAttributeLabel is not static method and it cause error in my application.
Great extension Yeti thank you!
I’ve just a question: I have to render a link in a CGridView cell.
I cannot get the correct value from the array ($data->filename):
$this->widget('zii.widgets.grid.CGridView', array(
'id' => 'sb-files-grid',
'dataProvider' => $dataProvider,
'columns' => array(
'filext',
'filename',
array(
'class'=>'CLinkColumn',
'label'=> 'File',
'urlExpression' =>'"file?fname=".$data->filename',
'header'=>'Download'
),
'filetime',
'filesize',
),
));
Change
to
'urlExpression' =>'"file?fname=".$data["filename"]',