【发布时间】:2018-05-29 08:53:15
【问题描述】:
请告诉我如何重新加载 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()中定义了不同的逻辑。如果我点击按钮一 (id1) 并执行函数
f1(),它会正常工作,但是当我点击按钮二 (id2) 并执行函数f2()时,它会执行相同的操作initContent()的逻辑 函数f1()。
【问题讨论】:
标签: javascript jquery jqxwidgets