为jQuery jEditable回调取消事件

时间:2013-01-30 13:40:59

标签: jquery jeditable

我使用Mike Tuupola的jQuery jEditable如下:

function wireupTagCategoryInPlaceEditing() {

    $('.category-label').editable(submitTagCategoryEdit, {
        event: 'tagcategoryedit', // conditionally triggered in wireupTagCategoryClick()
        type: 'text',
        submit: ' Ok ',
        cancel: 'Cancel',
        cssclass: 'tagcategory-inplace-edit'
    });

} 

function submitTagCategoryEdit(value, settings) {
    //handle the edit 
}

我需要拦截取消事件 - 这是最好的方法

1 个答案:

答案 0 :(得分:2)

使用thisthis

$("#editable_text").editable(submitEdit, { 
    //...
    onreset: jeditableReset,
    //...
});

function jeditableReset(settings, original) {
   // whatever you need to do here
}