Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/362.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何重新加载jqxwindowinitcontent:function()?_Javascript_Jquery_Jqxwidgets - Fatal编程技术网

Javascript 如何重新加载jqxwindowinitcontent:function()?

Javascript 如何重新加载jqxwindowinitcontent:function()?,javascript,jquery,jqxwidgets,Javascript,Jquery,Jqxwidgets,请告诉我如何重新加载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

请告诉我如何重新加载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() {});
    }
  });
}
现在整个场景是:

  • 我有两个按钮(按钮ID为:
    id1
    id2
    )。在两个按钮的“单击事件”上,我想用相同的代码执行两个不同的函数(函数名:
    f1()
    f2()
    ),但在这两个函数中,我在
    initContent:function()
    中定义了不同的逻辑

  • 如果我单击按钮1(id1)并执行函数
    f1()
    ,它将正常工作,但当我单击按钮2(id2)并执行函数
    f2()
    ,它将执行的
    initContent()
    的相同逻辑 函数
    f1()


  • initContent:function()
    将只执行一次。使用jqxWindow open事件动态创建内容

    $('#confirmContainer').jqxWindow('open',function(){
    
           // do the stuff here....
    });