cakephp ajax 帮助程序问题
找到的 ajax 助手
我目前正在使用在 http://www.cakephp.bee.pl/ 有手风琴,我想使用 $this->ajax 进行更新,
这里是 ajax 表单提交按钮的代码
<?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");'
));
?>
,这里是手风琴的格式
<div id="divleft">
<div id="accordion">
<h3><a href ></h3>
<ul>
<li>item 2</li>
<li>itejm 3</li>
</ul>
</div>
</div>
问题。
无法在不丢失手风琴功能的情况下更新手风琴,并且如果手风琴更新,它将失去其手风琴样式。
我的代码有问题吗
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>
</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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想问的第一件事是如何创建手风琴元素?您使用 AjaxHelper 类还是仅使用 jQuery 方法?
提交表单后,您将使用 jQuery UI 语法来销毁并重新创建新的折叠面板。但要使用 Helper 创建它,您必须使用 $ajax 对象及其函数。有没有办法让 AjaxHelper 更改 UI 定义并以某种方式包装它?
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?