jeditable回调的值为空///或//单击保存按钮后如何显示已编辑的文本? [英] jeditable callback has empty values //OR// How to display edited text after clicking save button?

查看:106
本文介绍了jeditable回调的值为空///或//单击保存按钮后如何显示已编辑的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码,该代码附加并在HTML表中的div元素上正确启动可编辑文件.该表是通过ajax调用生成的.我可以使用editable来更新后端,但是不能更新正在编辑的HTML table单元格?为此,我必须重新运行ajax查询以使用来自后端的新值重新显示该表.所以我的问题本质上是在成功提交后显示新值.

I have following code which attached and launches the editable properly on the div elements in the HTML table. the table is generated via ajax call. I am able to update the backend using the editable, but it is not updating the HTML table cell, which is being edited? for that i have to re-run the ajax query to redisplay the table with new values coming from backend. so my problem is essentially, to display the new value after successful submit.

为了解决我的问题,我想到了使用回调函数,但是我发现控制台日志中的回调函数的值和设置为空...

to address my issue, i thought of using callback function, but I found value and settings are empty in callback function in the console log...

我该如何解决我的问题?

how can i fix my issue?

$(".edit_area").editable('/cgi-bin/mycgiscript.cgi', {
event       : 'dblclick',       //or dblclick
type        : 'textarea',
rows        : 2,
cols        : 30,
cancel      : 'Cancel',
submit      : 'Save',
indicator   : '<img src="images/indicator.gif">',
placeholder : 'Double Click to enter text',
tooltip     : 'Double Click to edit...',
name        : 'name',
id      : 'id',
callback    : function(value, settings) {
console.log('value='+value);
console.log('settings='+settings);
console.log('callback executed='+value);
return(value);
}
});

我使用了回调,因为在保存"编辑后的文本之后.编辑后的文本不会显示在HTML页面上.它已正确保存在后端数据库中.我已经重新运行了ajax调用,该调用显示了来自后端服务器的更新信息...

I used callback, because after 'SAVE'ing the edited text. The edited text is not displayed on the HTML page. It is properly being saved in the backend database. I have re run the ajax call which displays the updated information from the backend server...

editable附加到通过ajax调用生成的html表中的div.如果有帮助...

editable is attached to the div in the html table which is being generated from an ajax call. if it helps...

推荐答案

已解决:其工作方式是:函数的ajax调用必须返回某些内容,您可以使用回调函数对其进行解析.所以一旦我的ajax调用开始吐出数据.我很好.

resolved: the way it works is: the ajax call of the function has to return something, which you can parse using the callback function. so once my ajax call started to spit out data. i was good.

全部收录.

这篇关于jeditable回调的值为空///或//单击保存按钮后如何显示已编辑的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆