X-editable with confirmation prompt using bootbox.js

可紊 提交于 2020-01-17 03:44:31

问题


I'm trying to add a confirm prompt into x-editable plugin. If I add using a normal javascript, it works. However, if I try to implement bootbox plugin, it fails. Below is an example of using a normal javascript that works.

if(!confirm("Are you sure you wish to proceed?")){
            $('#name2').editable('toggle');
            return "invalid";
        }

But if I add bootbox plugin like the example below, it fails to work. It actually change the value before the confirmation.

bootbox.confirm("Are you sure you want to cancel?", function(result) {
            if(result == 'false'){
                return "invalid";
            } else {
                return "";
            }
        });

Here's the jsfiddle for bigger picture. https://jsfiddle.net/f8vjmqtq/11/

来源:https://stackoverflow.com/questions/32344594/x-editable-with-confirmation-prompt-using-bootbox-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!