Bootstrap Select2 open a loading dialog onStart partial refresh

白昼怎懂夜的黑 提交于 2019-12-12 02:14:44

问题


I need to show a ext lib Dialog after the user select a combobox (I use a Select2 of BootStrap for XPages). The alert code function work well, but the XSP.openDialog not . I've found a old stackoverflow question about this but I don't understand how can I solve my problem. Any ideas?

Tnx a lot

$(document).ready( 
    function() {
        x$("#{id:comboBox1}").select2().on("change", function(e) {
            XSP.allowSubmit();
            XSP.partialRefreshPost("#{id:divView}",{
            onStart: function () {
                // do something when the partial update is finished
                //alert("start...") -- this WORK
                XSP.openDialog("#{id:dialog1}");  //this doesn't work

            },
            onComplete: function () {
                // do something when the partial update is finished
                //alert("stop...")  -- THIS WORK
                XSP.closeDialog("#{id:dialog1}"); //this doesn't work
            }
            }); 
          } ) 
    }
);

回答1:


I've found a solution with XSP.allowSubmit();, magic Sven Hasselbach!:

 $(document).ready( 
    function() {
        x$("#{id:comboBox1}").select2().on("change", function(e) {

            XSP.partialRefreshPost("#{id:divView}",{
            onStart: function () {
                // do something when the partial update is finished
                //alert("start...") -- this WORK
                 XSP.allowSubmit();
                XSP.openDialog("#{id:dialog1}");

            },
            onComplete: function () {
                // do something when the partial update is finished
                //alert("stop...")  -- THIS WORK
                 XSP.allowSubmit();
                XSP.closeDialog("#{id:dialog1}");
            }
            }); 
          } ) 
    }
);


来源:https://stackoverflow.com/questions/26116118/bootstrap-select2-open-a-loading-dialog-onstart-partial-refresh

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