1

jQuery UI ダイアログ オープン コールバックは 1 回しか実行されませんが、ダイアログが開くたびに実行したい..

$('<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(){
    $('#smartpaginate').smartpaginator({
      totalrecords: 3,
      recordsperpage: 2,
      datacontainer: 'all-tabs',
      dataelement: 'table',
      theme: 'green'
    });
  },
  buttons: {
    "Close": function(){
      $(this).dialog('close');
      return false;
    }
  }
});

open のコールバック関数は正しく実行され、ページネーションが生成されますが、閉じた後、ページネーションなしで開くたびに。

4

1 に答える 1

0

DOMからダイアログを削除してみてください。

$('<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(){
    $('#smartpaginate').smartpaginator({
      totalrecords: 3,
      recordsperpage: 2,
      datacontainer: 'all-tabs',
      dataelement: 'table',
      theme: 'green'
    });
  },
  buttons: {
    "Close": function(){
$(this).remove();
      return false;
    }
  }
});
于 2012-12-11T13:10:20.417 に答える