javascript - How to destroy a progressbar on dialog closing? -
i have these 2 functions 1 of them create dialog , other destroy progressbar,
after create dialog might need create progress bar inside , start it, when close dialog, progress bar keeps running in ground. need destroy or stop progress bar working. wrote createdialog function beforeclose event destroy progress bar doesn't work, , dialog not closing, close button none responsive.
function createdialog(trgt,h,w) { $( trgt ).dialog({ height:h, width:w, autoopen: false, show: { effect: "blind", duration: 200 }, hide: { effect: "blind", duration: 100 }, beforeclose: function( event, ui ) { destroyprogresspar(trgt); } }); } destroyprogresspar(dialg) { if(dialg=="#myfilesdialog") { $("#progressbar").progressbar("destroy"); } else if(dialg=="#ibrowser") { $("#progressbar2").progressbar("destroy"); } }
i tried making closing handler upon creating dialog (works messy):
$(trgt).on("dialogbeforeclose", function( event, ui ) { if(trgt=="#myfilesdialog") { $("#progressbar").progressbar("destroy"); } else if(trgt=="#ibrowser") { $("#progressbar2").progressbar("destroy"); } });
and works can't make call function instead if conditions (doesn't work):
$(trgt).on("dialogbeforeclose", function( event, ui ) { destroyprogresspar(trgt); });
Comments
Post a Comment