Grid Input Filter Name Custom

Hi guys,

I have a problem using grid with models which are namespaced.

So for example when I use a model like "Ekv\models\MMovies" I got grid filter inputs like

<input type="text" name="Ekv\models\MMovies[movieID]">

So I would like to know is there any way to customize this naming convention, to provide an input base name maybe?

As I saw from the yii internals it’s quite tied to the model name of grid (CHtml::resolveName())




return get_class($model).'['.substr($attribute,0,$pos).']'.substr($attribute,$pos);



but maybe I’m missing something and there is some way to change it?

Please look at the attachment, for detailed explanation.

If I understand correctly you need to use a "filter" attribute of the "columns" attribute.

For example:


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

	'id'=>'grid-id',

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

	'filter'=>$model,

	'columns'=>array(

        array(

            'name' => 'first_column',

            'value' => '$data->first_column',

            'filter' => CHtml::textField('custom_name', 'value'), //THIS!!! 

        ),

        'second_column',

	array(

		'class'=>'CButtonColumn',

	),

),

)); ?>

Hope you mean this. It’s very hard to me the understand an English. Sorry :(