2015-11-10 18 views
1

我想按摩X编辑提交一份关于“停止打字”的背景下...X编辑提交关于停止打字

这里是我该怎么做:

$('.editable').on('shown', function(e, editable) { 
    $(editable.input.$input).keyup(_.debounce(function(){ 
     <...Here should com the correct submit code...> 
     $(editable.input.$input).editable('submit', editable.options); 
    } , 1000)); 
    }); 

的问题是这行只是不起作用。

$(editable.input.$input).editable('submit'); 

我收到此异常:

Uncaught TypeError: Cannot read property 'options' of undefined 
$.fn.editable @ bootstrap-editable.js?body=1:2058 
(anonymous function) @ unobtrusive.js?body=1:225 
later @ underscore.js?body=1:846 

任何想法我怎么能提交? 理想情况下,我想使用之前可编辑调用分配的选项提交。

这是以前的调用:

$('.new_association_record').editable({ 
    ajaxOptions: { 
    type: 'post', 
    dataType: 'script' 
    }, 

回答

0

后疼痛的时间我查编辑... 文档的源可惜没有UPTODATE。为了使用,我们需要更多数据的“提交”消息...

所以这个代码工作得很好:

editable.input.$input.closest('form').submit();