Aladdin
(Aladdinhoms)
April 23, 2012, 6:13pm
1
I have one cgridview inside another cgridview:
the outer one is:
$this->widget('application.modules.user.components.CsvGridView', array(
'dataProvider'=>$model->mySearch(),
'filter' => $model,
'id'=>'users-grid',
...
the inner one is:
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'vacr-grid',
'dataProvider'=>$model->searchu(),
// 'pager'=>false,
// 'enableSorting'=>false,
'summaryText'=>'',
'ajaxUpdate'=>'vacr-grid',
'columns'=>array(
'start',
'end',
array(
'name' => 'vac_type',
'value' =>
'isset($data->vacType->name)?$data->vacType->name:$data->vac_type'
),
),
));
The problem is that the inner one does not update properly (of course update with ajax).
when I click on "next" for example, in the inner cgridview, the requested URL is:
http://localhost/orm/vac/vac/adminu/user_id/1/Vac_page/2?ajax=users-grid
notice that users-grid is the id of the outer cgridview. and then after I click on "next" the inner and the outer cgridviews both disappears.
I try to use ajaxUpdate property but it does not affect anything. thank you.
softark
(Softark)
April 24, 2012, 10:50am
3
Hi Aladdin,
I’m sorry but I don’t understand what you mean by ‘outer’ and ‘inner’.
I’m afraid nobody would.
Won’t you please elaborate your view code and controller code a little more?
Where is the inner grid located? Just under the outer grid? Or, I don’t believe it but, in one of the cell of the outer grid?
Aladdin
(Aladdinhoms)
April 24, 2012, 5:25pm
4
softark:
Hi Aladdin,
I’m sorry but I don’t understand what you mean by ‘outer’ and ‘inner’.
I’m afraid nobody would.
Won’t you please elaborate your view code and controller code a little more?
Where is the inner grid located? Just under the outer grid? Or, I don’t believe it but, in one of the cell of the outer grid?
@softark thank you for telling me that.
so simply, I have a grid (the outer one), in each grid row in it, I have an ajax button witch expands the row and adds a new grid inside the row (the inner one). the problem is that I haven’t a live site.
softark
(Softark)
April 24, 2012, 10:51pm
5
Aladdin:
@softark thank you for telling me that.
so simply, I have a grid (the outer one), in each grid row in it, I have an ajax button witch expands the row and adds a new grid inside the row (the inner one). the problem is that I haven’t a live site.
Wow, that’s wonderful.
But I think you have to show us some code to illustrate how it is organized. It sounds a little complicated and probably no one can imagine what you are really doing, let alone give you some advise.