cakephp helper ajax,jquery - cakephp ajax helper issue - Stack Overflow

在尝试使用CakePHP的AjaxHelper更新一个Accordion时,遇到问题:更新内容后失去Accordion功能和样式。代码中设置了'before'、'after'、'complete'和'success'事件,但似乎并未达到预期效果。问题可能在于Accordion的重建和样式恢复过程。
摘要由CSDN通过智能技术生成

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

  • item 2
  • itejm 3

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值