Now, trying to find a solution I stumble upon a strange case… at [font="Lucida Console"]admin.php[/font]:
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'agent-grid',
'dataProvider' => $model->search(),
'ajaxUrl' => Yii::app()->createUrl($this->route, array( 'Agent[type]' => $model->type ) ),
'filter' => $model,
'columns'=> array( ... ) )
So, ajaxUrl goes with the [font="Lucida Console"]type[/font] parameter fixed; so far so good. But when the user sends a new query, the [font="Lucida Console"]Agent[type]=<type>[/font] is lost at [font="Lucida Console"]jquery.yiigridview.js[/font]:
if(options.data!==undefined && options.type=='GET') {
options.url = $.param.querystring(options.url, options.data);
options.data = {};
}
It seems that [font=“Lucida Console”]jquery.ba-bbq.js[/font], [font=“Lucida Console”]querystring( ajaxUrl, userData, merge = 0)[/font] function doesn’t understand array parameters, so it erases [font=“Lucida Console”]Agent[type]=<type>[/font] ? Could it be related to html encoding? Agent[…] => Agent%5B…%5D ??
If I use it without array parameters, runs fine:
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'agent-grid',
'dataProvider' => $model->search(),
'ajaxUrl' => Yii::app()->createUrl($this->route, array( 'type' => $model->type ) ),
'filter' => $model,
'columns'=> array( ... ) )
In the controller actionAdmin() I need to add:
if(isset($_GET['Agent']))
$model->attributes = $_GET['Agent'];
if( isset( $_GET['type'] ) )
$model->type = $_GET[ 'type'];
cbi