javascript - jquery ui dialog modal only opens once using class selector -
$(".groomed").click(function() { var modal = $(".dash-modal", this).dialog({ height:400, width:800, modal:true, autoopen: false, cancel: function() { $(".dash-modal", this).dialog("destroy"); } }); console.log(modal); modal.dialog('open'); });
i have gone threw of stack overflows , deal id selector , need work class selector. code included above.
the console logs following first click:
[div#ui-id-2.dash-modal info ui-dialog-content ui-widget-content, prevobject: e.fn.e.init[1], context: tr.groomed, selector: ".dash-modal", constructor: function, init: function…]
and second: [prevobject: e.fn.e.init[1], context: tr.groomed, selector: ".dash-modal", constructor: function, init: function…]
so looks entire functionality being removed after modal closed, api says use destroy, i've tried both close: , cancel:
please help, thanks!
cancel: function() { $(".dash-modal", this).dialog("destroy"); }
by destroy dialog box
close dialog box use according requirement
cancel: function() { $(".dash-modal", this).dialog("close"); }
reference dialog close , dialog destroy
Comments
Post a Comment