Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/468.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript x-可编辑:取消evert的回调_Javascript_X Editable - Fatal编程技术网

Javascript x-可编辑:取消evert的回调

Javascript x-可编辑:取消evert的回调,javascript,x-editable,Javascript,X Editable,对于Twitter Bootstrap X Editable(),有一个成功和错误的回调。但是没有什么可以取消的。有没有办法监听特定可编辑文件的取消事件?找到了: $('#element', this.$e).editable({ type: 'text', toggle: 'manual', success: function(response, newValue) { //some action }.bind(this) }).on('hi

对于Twitter Bootstrap X Editable(),有一个成功和错误的回调。但是没有什么可以取消的。有没有办法监听特定可编辑文件的取消事件?

找到了:

  $('#element', this.$e).editable({
    type: 'text',
    toggle: 'manual',
    success: function(response, newValue) {
      //some action
    }.bind(this)
  }).on('hidden', function(e, reason) {
    if (reason == "cancel") {
      //some action
    }
  });

您可以在“隐藏”上定义一个侦听器,并检查取消、提交或手动的原因。

为什么不接受答案?忘了,谢谢你的提醒