Yii Framework Forum: CListView - incorrect element updating (on paginate) - Yii Framework Forum

Jump to content

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

CListView - incorrect element updating (on paginate) Rate Topic: -----

#1 User is offline   vamp 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 181
  • Joined: 30-January 09

Posted 19 March 2010 - 04:34 AM

jquery.yiilistview.js:

replace:
88:  					$('#'+this).html($(data).find('#'+this));


to:
88:  					$('#'+this).replaceWith($(data).wrap('<span>').parent().find('#'+this+':first'));


.replaceWith(...) - because after each update operation new element (with ID) inserted in element with original ID
Posted Image

.wrap('<span>').parent().find(..) - to find first element with given id (try to:

$('<div id="yw0">..</div>').find('#yw0').length // result = 0 - mistake!

with .wrap('<span>').parent().find(..) all works fine!)
-Posted Image-
Thanks, you make me stronger!
0

#2 User is offline   RainMonk 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 19-July 09
  • Location:Poland

Posted 29 March 2010 - 06:11 PM

Hi vamp - You have right - it's a bug, but solution is more simply:

replace:
88:                                     $('#'+this).html($(data).find('#'+this));


to:
88:                                     $('#'+this).html($(data).find('#'+this+' > *'));


Regards!
0

#3 User is offline   vamp 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 181
  • Joined: 30-January 09

Posted 29 March 2010 - 06:19 PM

View PostRainMonk, on 29 March 2010 - 06:11 PM, said:

Hi vamp - You have right - it's a bug, but solution is more simply:

replace:
88:                                     $('#'+this).html($(data).find('#'+this));


to:
88:                                     $('#'+this).html($(data).find('#'+this+' > *'));


Regards!



first of all:
$('<div id="test">asd</div>').find('#test > *'); - not works correctly :)

second - $('#'+this).find('#'+this+' > *') - doesn't find text nodes! :rolleyes:
-Posted Image-
Thanks, you make me stronger!
0

#4 User is offline   RainMonk 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 19-July 09
  • Location:Poland

Posted 29 March 2010 - 06:44 PM

Hmmm.. You have right.

But in blog works good, becouse any text is inside html's tags.
0

#5 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,134
  • Joined: 17-January 09
  • Location:Russia

Posted 14 April 2010 - 04:45 PM

Is there a ticket for it?
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
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