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 联系我们: