Diaog open回调函数只执行一次

[英]Diaog open callback function executes only once

My jQueryUI dialog open callback function executes only for the first time the dialog opens but I want it to work every time I open the dialog. Can anyone help?


$('<div><b><center>'+ text +'</center></b></div>').dialog({
    title: '<b>User(s) with a similar name</b>', 
    modal: true,
    autoOpen: true,
    height: 'auto', 
    width: 400,
    resizable: false,
    open: function() { 
            totalrecords: 3,
            recordsperpage: 2, 
            datacontainer: 'all-tabs', 
            dataelement: 'table',
            theme: 'green' 
    buttons: {
        "Close": function() {
            return false;

The code in the callback executes a pagination plugin, Jquery smart paginator.


1 个解决方案



As said, this code snippet is not enough to understand your problem. See in this fiddle that the open callback function is always called. I have just added a smartpaginate div and a button to control the dialog opening :

如上所述,此代码段不足以理解您的问题。在这个小提琴中看到始终调用开放回调函数。我刚刚添加了一个smartpaginate div和一个按钮来控制对话框的打开:

<button id="opener">open the dialog</button>
<div id="dialog" title="Dialog Title"><div id="smartpaginate"></div></div>

And a message to visualize that the call is performed :


$('#opener').after('<p>dialog open function triggered</p>');

Maybe you should have a look in your js console, and give us more context.




  © 2014-2022 ITdaan.com 联系我们: