JQuery dialog not opening second time on click -
this code open jquery dialog. works first time (gets opened) not second time (not opening). similar question asked here not working me
function loadgridview(id, row) { var dlg = jquery('#edit').load('edit.aspx'); dlg.dialog({ autoopen: false, modal: true, show: 'slide', close: 'slide', width: 400, height: 160, buttons: { "cancel": function() { dlg.dialog("close"); } } }); dlg.dialog("open"); }
your dlg scope not exist when try open second time, need store globally
// global var hold dlg var dlg; $(document).ready(function() { // element , store in dlg global var scope may retain dlg = $("[id$='edit']"); dlg.dialog({ autoopen: false, modal: true, show: 'slide', close: 'slide', width: 400, height: 160, buttons: { "cancel": function() { dlg.dialog("close"); } } }); });
Comments
Post a Comment