2

Please tell me how to reload the content of jqxwindow initContent: function (). I created a div in jsp for all the ids below.

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() {});
    }
  });
}

Now the whole scenario is:

  1. I have two buttons (ID of buttons are: id1 and id2). On both buttons' click event I want to execute two different functions (function name: f1() and f2()) with the same code, but in both functions I define different logic in initContent: function().

  2. If I click on button one (id1) and execute the function f1() it will work fine, but when I click on button two (id2) and execute the function f2(), it will execute the same logic of initContent() of Function f1().

Albert Einstein
  • 7,472
  • 8
  • 36
  • 71

1 Answers1

0

The initContent: function() will execute only once. Use jqxWindow open event to make things dynamically

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

       // do the stuff here....
});
Sumesh TG
  • 2,557
  • 2
  • 15
  • 29