Yii grid

Just wanted to note that i have just released Version 0.2 of the editable Gridview.

It contains some bugfixes and, most importantly, it automatically renders a Drop-Down Field when you can choose between a bunch of "related" Elements (for example post.author). To achieve this, it uses another Extension i wrote (Relation) - it is contained in the bundle. Get it here: http://www.yiiframework.com/extension/editablegridview/

only things missing is to filter the elements that are displayed in the CDropDownMenu (maybe you don´t want to make the user choose one of _every_element) and - most important some jquery javascript function to make the Editable Columns saveable. Both will be released soon :)

Note: When using the newest “filter”-technique of Yii the automatic relation resolvment fails; so be sure to comment out the ‘filter’ => $model, generated by the yiic crud command.

Is it possible to pass some custom data(like get a directory content) to the dataprovider in the controller, and in the view page display it in a gridview? Or i have to do it some otherway?

You can explicitly set the "data" property of the data provider.

Yeah i did that, but after, i put all those datas into that property how can i display them in the gridview? or the datas must be in a specific structure for this data property?

I join a question. Maybe there is the way to make ‘visible’ property evaluated?

Found bug using cgridview + datafilter when searching a keyword contain "/" as reported here :

cgridview search problem

Anybody experience same problem ?

Pls. help.

majin

Had the same need so I created this extension: http://www.yiiframew…mybuttoncolumn/ that adds the ‘visible’ option to a button.

ye ,works nice mdomba,mybuttoncolumnlooks nice!thanks

Note that as of Yii version 1.1.1 the visible attribute is added to the core, so this extension is not needed.

http://www.yiiframework.com/doc/api/CGridColumn#visible-detail

I would like to implement a simple reset button in CGridView that clears all header fields of input and returns the CGridView to its initial, all header fields empty state.

I’m a newbie and I have tried several perhaps idiotic approaches, none of which has come close to working.

Any suggestions from the advanced minds here on this?

@stickdog:

I tend to go the easy way. So how about adding a simple link to the same page, without any parameters? That should reset the grid:


<?php echo CHtml::link('reset',array('your/route')); ?>

Hi All,

i am a newbie to Yii, we already have a CRM application which is developed in plane PHP an now thinking to re-write it using Yii. Excellent framework so far after migrating few screens

please help me with the below

  1. while working with grid i want to change the text displayed for active field as 1=>Active 0=>Inactive

using the below code


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

	'id'=>'user-grid',

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

	'filter'=>$model,

	'columns'=>array(

		/*'id',*/

		'first_name',

		'last_name',

		'username',

		'email',

		array(

           'dataField'=>'active',

           'dataExpression'=>'DRView::translate("AI",$data->active)'

        ),


		'active',

		'user_type',

		/*'date_added',*/

		/*

		 * 

		 * 'alternate_email',

		'password',

		'user2address',

		'date_last_modified',

		'date_last_login',

		*/

		array(

			'class'=>'CButtonColumn',

		),

	),

)); ?>

getting the below error


Property "CDataColumn.dataField" is not defined. 

  1. Also in case of table state we are saving the foreign key of table country, how do i show country label in the grid instead of the PK from table country?

Hi All,

please could someone assist with the above questions? I am sure this is very basic & would not take long for someone who is working with Yii for some time. any pointers would be appreciated

Thanks


		array(

					'name' => 'status',

					'filter' => array(

						0 => 'Inactive',

						1 => 'Active',

						2 => 'Special state',

						),

					'value' => '$data->printStatus()'

					),


	public function printStatus() {

		if($this->status == 0)

			return 'Inactive';

		if($this->status == 1)

			return 'Active';

		if($this->status == 2)

			return 'Special state';


	}



i am newbie using yii and php. currently i was able to add the new records using the editable gridview, but when i delete, it will prompt me twice times and after that, the add will not working.

can someone advise me?

however, i also would like to create the button to do the update for all the records display from the editable gridview. can someone guide me how to do so?

attachment is my controller and form that i use.

thanks.