CArrayDataProvider + button column

Dont know how to do it…

I get 500 Trying to get property of non-object




$this->widget('zii.widgets.grid.CGridView',

	array(

		'id'=>'tableView',

		'dataProvider' => $dataProvider,

		'columns' => array(

				array(

						'name' => 'id',

				),

				array(

						'header' => 'test',

						'class' => 'CButtonColumn',

				),

		),

));



if i remove the CButtonColumn all works fine

The key to the answer is CArrayDataProvider

with some hacking I managed to add the column… bit it empty :mellow:




$columnsForGridView = array();

		foreach($tableRows as $row){

			$columnsForGridView[] = array('name' => $row);

		}

//... in grid

'columns'=>$columnsForGridView	+ array(

   'class' => 'CButtonColumn',

 ), 



Issue solved, data from here helped me

http://www.yiiframework.com/forum/index.php?/topic/16435-cgridview-filters-with-carraydataprovider/