2

请告诉我如何重新加载 jqxwindow 的内容 initContent: function ()。我在 jsp 中为下面的所有 id 创建了一个 div。

Function f1() {
  var themeName = 'bootstrap';
  var lp = Number((window.screen.width-900)/2);
  var tp = Number((window.screen.height-400)/2);

  $('#confirmContainer').css('display', 'block');
  $('#confirmContainer').jqxWindow({
    position: { x: lp, y: tp},
    maxHeight: 150, maxWidth: 420, minHeight: 30, minWidth: 250, height: 100, width: 400,
    resizable: false, isModal: true, modalOpacity: 0.3, theme: themeName,
    okButton: $('#confirmOk'),
    cancelButton: $('#confirmCancel'),
    initContent: function() {
      $('#confirmOk').jqxButton({width: '65px', theme: themeName});
      $('#confirmCancel').jqxButton({width: '65px', theme: themeName});
      $('#confirmCancel').focus();
      $('#confirmTitleMessage').html('Confirmation');
      $('#confirmContentMessage').html("Do you want to update ?");
      $('#confirmOk').click(function() {
        notyutil.showMessage("Requested process has been completed.");
      });
      $('#confirmCancel').click(function() {});
    }
  });
}

现在整个场景是:

  1. 我有两个按钮(按钮的 ID 是:id1id2)。在两个按钮的单击事件中,我想使用相同的代码执行两个不同的函数(函数名:f1()f2()),但是在这两个函数中,我在initContent: function().

  2. 如果我单击按钮一(id1)并执行该功能f1(),它将正常工作,但是当我单击按钮二(id2)并执行该功能f2()时,它将执行与initContent()Function相同的逻辑f1()

4

1 回答 1

0

initContent: function()只执行一次。使用jqxWindow打开事件动态做事

$('#confirmContainer').jqxWindow('open',function(){

       // do the stuff here....
});
于 2018-01-30T08:27:56.443 回答