php - ZF2 - show jQuery Ui Dialog -
i want pop-up jquery ui dialog, doesnt work. instead of dialog, new page opened. code next:
controller's action:
public function diaaction() { $viewmodel = new viewmodel(); $viewmodel->setterminal(true); return new viewmodel(); }
index.phtml:
<a class="some-link" title="title here" href="<?= $this->url('dialog', array('action' => 'dia'))?>">open form</a>
dia.phtml (dialog code)
<script type="text/javascript"> $(document).ready(function() { $('.some-link').each(function() { var $link = $(this); var $dialog = $('<div></div>') .load($link.attr('href')) .dialog({ autoopen: false, title: $link.attr('title'), }); }); }); </script>
i don't it, why not simple should be. help?
you have handle 'click' show dialog instead of following link. this:
$('.table a.button').on('click',function(e){ e.preventdefault(); $('<div></div>') .load($link.attr('href')) .dialog({ autoopen: false, title: $link.attr('title'), }); });
Comments
Post a Comment