II just want it to list
a bunch of fields from the database table and if the edit button is selected go to a view for update.
The trouble Is I can not figure out thus far how to access the keyField which I need in my edit button event:Here is an excerp of working code:
I know the $dataProvider defines an array with
I can generate the data grid and it fills in the columns in the grid with good data, however
[size="7"]What can I do to extract the id value [/size]
I mean the Id columbn value displayed in the grid
Note the dataprovider used:
$dataProvider = new CSqlDataProvider($sql,array(
'keyField'=>'Id',.
So far I have tried:
obtaining the values I need via:
$dataProvider->params->keyField ?
$dataProvider->params->keyField->id ?
I also noted that the CSqlDataProvider
$this->widget(‘zii.widgets.grid.CGridView’, array(
'id'=>'gridx', <img src='http://www.yiiframework.com/forum/public/style_emoticons/default/ohmy.gif' class='bbc_emoticon' alt=':o' />
'dataProvider'=>$dataProvider,
'columns'=> array(
array(
'class'=>'CButtonColumn',
‘template’=>’{update}’,
'updateButtonUrl'=>'Yii::app()->createUrl("GoUpdateRec",
array("id"=>$dataProvider->params->keyField
)
)’,) ,
‘Id’,‘TitleId’,‘UserId’
)
)
)
I already tried print_r on the dataprovider
Then tried $dataProvider->
There has to be a way to access the data for the grid columns either directly via the grid object or
the dataprovider object. It stands to reason.
Perhaps using the properties or methods available in those objects or parent class objects??
PLEASE PLEASE PLEASE LAUGH AT ME ALL YOU LIKE BUT HELP ME. I REALLY NEED THE HELP ON THIS
I have a perfectly good Grid screen