updating x-editable input field based on returned value

ε祈祈猫儿з 提交于 2019-12-06 02:26:16

the simplest way:

        $('.textarea').editable({
            success: function(response, newValue) {
                    return {newValue: response.newValue};
                }
            }
        });

remember to return newValue variable in response content:

{"newValue":"some_string_new_value"}

this worked. I'm setting the value by calling this function in the on success callback

  function formatXEditable($item, $val){
    $val = $val.replace(/<br\s*\/?>/mg,"\n");
    $($item).on('shown', function(e, editable) {
      editable.input.$input.val($val);
    });
  }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!