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