Yii Framework Forum: ajaxSubmitButton, ajaxButton, and nested CJui widgets not working - Yii Framework Forum

Jump to content

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

ajaxSubmitButton, ajaxButton, and nested CJui widgets not working Rate Topic: -----

#1 User is offline   smclark89 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 119
  • Joined: 20-June 09
  • Location:NY, USA

Posted 01 June 2010 - 05:45 PM

I've got a CJuiTabs with ajax links in the headers, which call controller actions by ajax and partially render a form underneath.

Unfortunately, I can't use CJuiAccordion inside the CJuiTabs in this arrangement; and I just noticed that none of my ajax links or buttons work either inside this tab arrangement. Does anybody have any idea why this would be?
0

#2 User is offline   zaccaria 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 2,232
  • Joined: 04-October 09
  • Location:Moscow

Posted 02 June 2010 - 09:10 AM

ajax link are quite fragile, they can have some problems because the js code is not embedded in the tag, but is attached to them using the id.

Checking the code of a page, you can see how all ajax lika are just tag a with an id like #yt1, and in the bottom of the page there is smth like:

Query('#yt1').live('click',function(){jQuery.yii.submitForm ...


That system sometime has problem, expecially when link are in some response.

If an ajax link have to me refreshed by an ajax request, I usually create ajax link like that:
return CHtml::link(
	$label,
	'',
	array(
		'onClick'=>CHtml::ajax(array
		(
			'url'=>$url,
			'update'=>$div,
			'type'=>'POST',
						
		)), 
		'style'=>"cursor:pointer;"
	)
);



Like that there are no id that can be ambiguous, it generate a tag with embedded his code. This kind of like always work, even after ajax request.
0

#3 User is offline   smclark89 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 119
  • Joined: 20-June 09
  • Location:NY, USA

Posted 07 June 2010 - 02:55 PM

That does the trick, thanks! It adds that bit of code bloat though... I wish it didn't have to work like this :(
0

#4 User is offline   zaccaria 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 2,232
  • Joined: 04-October 09
  • Location:Moscow

Posted 08 June 2010 - 02:00 AM

Actually is a bit strange, because the default is "sort all field of the table" and if you don't want the default, the only alternative is "if you don't like my way, do all on your own"...

That's not a bad philosophy, but maybe to have the possibility of write something "sort all field of the table plus this one" should be nice.

For now you should do all on your own.
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