在我的x-editable字段中,我有一个textarea,我想根据返回的值更新.这在我使用时$(this).html(newVal);
如下所示
success: function(response, newValue) { newVal=unescape(JSON.parse(response).VALUE) $(this).html(newVal); }
问题是当我第二次点击编辑字段时,输入对象(class editable-input
:)中的值保持与发送时相同. 有没有办法来解决这个问题?
最简单的方法:
$('.textarea').editable({ success: function(response, newValue) { return {newValue: response.newValue}; } } });
记得在响应内容中返回newValue变量:
{"newValue":"some_string_new_value"}