开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜