0
我在一個保存按鈕上保存了三個選項卡,但是當點擊保存按鈕時,我試圖禁用該按鈕,同時將數據保存在三個選項卡中以防止用戶在保存按鈕上點擊幾次,因爲我的功能超時。任何幫助如何做到這一點?在extjs4.2保存後禁用按鈕
Ext.onReady(function(){
tabPanel = Ext.create('Ext.tab.Panel', {
region: 'center',
activeTab: 0,
autoScroll: true,
tbar: [{
xtype: 'button',
deferredRender : false,
handler:function(){
save("frm_A", save);
},
}],
items: [
{
id:"panel_A",
html: "<iframe src= '"+A_url +"' width='100%' height='100%' id='frm_A' name='frm_A' frameborder=0 />",
},{
id:"panel_B",
html: "<iframe src='"+B_url+"' width='100%' height='100%' id='frm_B' name='frm_B' frameborder=0 />",
},{
id:"panel_C",
html: "<iframe src= '"+C_url+"' width='100%' height='100%' id='frm_C' name='frm_C' frameborder=0 />",
}]
});
viewport = new Ext.Viewport({
layout:'border',
items:[tabPanel]
});
function save(record){
var Aid = record.getField("NUMBER").getRealValue();
var currentTab = tabPanel.getActiveTab();
tabPanel.setActiveTab(1);
tabPanel.setActiveTab(2);
tabPanel.setActiveTab(0);
tabPanel.setActiveTab(currentTab);
var B= window.frames["frm_B"];
var C= window.frames["frm_C"];
setTimeout(function(){
try {
B.RECORD.getField("ID").setRealValue(Aid);
C.RECORD.getField("ID").setRealValue(Aid);
B.RECORD.update();
C.RECORD.update();
parent.refreshGrid();
parent.win.close();
}
catch(e){
showError(e);
}
}, 4000);
}
});