Yii Framework Forum: CGridView multiple confirm and data send issue - Yii Framework Forum

Jump to content

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

CGridView multiple confirm and data send issue Rate Topic: ***** 1 Votes

#1 User is offline   dckurushin 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 392
  • Joined: 16-March 11
  • Location:Israel

Posted 08 October 2011 - 07:42 PM

there is CGridView multiple confirm and data send issue

issue described here

http://www.yiiframew...-delete-button/

if you read this (the end of it) http://www.alfajango...y-live-and-die/

you will understand that I cant do die to the function...

so if I load the CGridView via ajax, it will add the click event every time... and after some time I get handred of them...

I think the best is to go from live to delegate...

just playing now trying to figure out how to kill previus live('click') or deleegate ("a.delete", "click"

if I figure out something I will post
0

#2 User is offline   dckurushin 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 392
  • Joined: 16-March 11
  • Location:Israel

Posted 08 October 2011 - 08:15 PM

figured out how to solve it

in CButtonColumn replace

$js[]="jQuery('#{$this->grid->id} a.{$class}').live('click',$function);";


with
$js[]="if(jQuery('body').attr('deleteEventIsset') !== 'yes'){jQuery('body').attr('deleteEventIsset', 'yes');jQuery('#{$this->grid->id} a.{$class}').live('click',$function);}";


you can add to the attribute the grid id or something also...

tested it... it solved my issue
0

#3 User is offline   dckurushin 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 392
  • Joined: 16-March 11
  • Location:Israel

Posted 09 October 2011 - 03:03 AM

There is also issue like that in the pagination... it add every page load via ajax and after some time for going from page 1 to 2 it will do 100 requests

CGridView works very bad inside a div after inserted via ajax...
the first time it loaded it is ok, but after some times it add up all the events and become a mess...

I actually considering using iframe instead of div...

Too much issues ...
0

#4 User is offline   dckurushin 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 392
  • Joined: 16-March 11
  • Location:Israel

Posted 09 October 2011 - 03:15 AM

Moderators: I think this topic place is inside bugs
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