//event callback (add in grid options)toggle: function(evt, ui){ $("#popup").dialog({ closeOnEscape: ui.state != 'max' });},