Yii Framework Forum: Yii cgridview ajaxUpdate property - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii cgridview ajaxUpdate property one cgridview inside another Rate Topic: -----

#1 User is offline   Aladdin 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 53
  • Joined: 20-July 11

Posted 23 April 2012 - 01:13 PM

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.
0

#2 User is offline   Aladdin 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 53
  • Joined: 20-July 11

Posted 24 April 2012 - 01:15 AM

any suggestion?
0

#3 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 1,527
  • Joined: 16-February 11
  • Location:Japan

Posted 24 April 2012 - 05:50 AM

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?
0

#4 User is offline   Aladdin 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 53
  • Joined: 20-July 11

Posted 24 April 2012 - 12:25 PM

View Postsoftark, on 24 April 2012 - 05:50 AM, said:

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.
0

#5 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 1,527
  • Joined: 16-February 11
  • Location:Japan

Posted 24 April 2012 - 05:51 PM

View PostAladdin, on 24 April 2012 - 12:25 PM, said:

@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. :blink:
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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users