cakephp ajax helper issue
I am currently using the ajax helper found at http://www.cakephp.bee.pl/
I have accordion i would like to update using $this->ajax
here is code for the ajax form submit button
<?php echo $ajax->submit('Submit', array(
'url'=> array(
'controller'=>'qnotes',
'action'=>'add'
),
'update'=>'divleft',
'position'=>'html',
'before'=>'$("accordion").accordion("disable");alert("before");',
'after'=>'$("#accordion").accordion("destroy").accordion({autoHeight: false, collapsible: false , active: false, header: "h3"});alert(response.requestText)',
'complete'=>'$("#accordion").accordion("destroy").accordion({autoHeight: false, collapsible: false , active: false, header: "h3"});',
'success'=>'$("#dialog1").dialog("close");'
));
?>
here the format of the accordion
<div id="divleft">
<div id="accordion">
<h3><a href ></h3>
<ul>
<li>item 2</li>
<li>itejm 3</li&开发者_StackOverflow社区gt;
</ul>
</div>
</div>
The Issue.
Cannot update the accordion with out losing the accordion functionality and if the accordion updates it loses its accordion styling.
Is there something wrong in my code
First thing I want to ask is how do you create the accordion element? Do you use the AjaxHelper class or simply the jQuery method?
After you submit the form, you are using jQuery UI syntax to destroy and recreate new accordion. But to create it using the Helper, you would have to use the $ajax object and it's functions. Is there a way, that AjaxHelper changes the UI definition and wraps it somehow?
精彩评论