【问题标题】:Switching xeditable off and on using editable("destroy");使用 editable("destroy") 关闭和打开 xeditable;
【发布时间】:2014-11-26 16:52:40
【问题描述】:

我正在尝试使用 editable("destroy") 打开和关闭 xeditable。 Xeditable 关闭但不会重新打开。函数如下所示:

$("#changeType").on("change", function () {
    switch ($(this).prop("checked")) {
        case true:
            $("#status").editable("destroy");
            $("#status").editable({
                showbuttons: false,
                onblur: 'ignore',
                mode: 'inline',
                send: 'never',
                success: function (params) {
                    return false;
                }
            }).editable('show');
            break;
        case false:
            ("#status").editable("destroy");
            ("#status").editable();
            break;
    };
});

请看我的 jsfiddle http://jsfiddle.net/ykay/vdoz07qz/3/

【问题讨论】:

  • 我已回滚您的编辑。请不要以使答案无效的方式编辑问题。

标签: jquery x-editable


【解决方案1】:

您的case false: 中有错字(缺少$ 符号)

$("#status").editable("destroy");
$("#status").editable();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-06
    • 1970-01-01
    • 1970-01-01
    • 2022-11-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多