CGridView ist ein Update möglich ?

Also meine Frage ist ob ein direkter Update in dem CGridView möglich ist.

zb.




<?php $this->widget('zii.widgets.grid.CGridView', array(

	'id'=>'grid',

	'dataProvider'=>$model->search(), 

	'filter'=>$model,

        ),

        

	'columns'=>array(	

                array(

                    'header'=>  Yii::t('cp', 'Archiviert'),

                    'name'=>'archived',

                    'value'=>'$data->archived == 0 ? "nein" : "ja"',

                    'htmlOptions'=> array( 'width'=>100 ),

                ),

	),

)); ?>



Das man dann Archiviert wenn es auf nein steht also denn Wert 0 hat ihn auf 1 macht.

Please, post in the german forum or ask in english!

So you want to change the value of your ActiveRecord class directly via CGridView? I don’t think that this is possible as this widget is ment for displaying records, not updating them, but you could try to add javascript.

Maybe this could be of interest: http://www.yiiframework.com/wiki/159/cgridview-and-ajaxform-connect/

Another forum post: http://www.yiiframework.com/forum/index.php?/topic/10639-solved-ajax-update-in-cgridview/page__p__52272__hl__update+cgridview#entry52272

OOHHH SORRY i haven’t seen it that i was not i the German Forum .