我有一个网格,在该网格中,底部有一个保存按钮。点击保存按钮,我打开窗口。
{
xtype: 'button',
text: "Save",
handler: function () {
new Wind({
title: "Change"
}).show();
}
}
然后这是窗口的代码。
Ext.ns();
Wind = Ext.extend(Ext.Window, {
width: 350,
height: 150,
initComponent: function () {
var p = this;
Ext.apply(p, {
modal: true,
layout: {
type: 'fit'
},
items: [{
xtype: 'textarea',
id: "ChangeText",
name: 'reasonforallchanges',
}],
buttons: ['->', {
text: "Save",
width: 80,
disabled: false,
scope: this,
handler: this.Savechange,
}, {
text: "cancel",
name: 'cancelchanges',
scope: p,
handler: function () {
this.close();
}
}]
});
Wind.superclass.initComponent.apply(this, arguments);
},
listeners: {
show: function () {
this.focus();
}
},
onEsc: function () {
this.close();
},
Savechange: function () {
debugger;
var modifiedTextCmp = Ext.getCmp('RFCText');
modifiedTextCmp = modifiedTextCmp.fireEvent('click', modifiedTextCmp);
var grid = Ext.getCmp('GRID');
var gridstore = grid.getStore();
var modifyRec = gridstore.modified;
var ReasonDetail = modifyRec.getValue();
for (var i = 0; i < modifyRec.length; i++) // Setting VAlue here
modifyRec[i].set("ABC", modifiedReasonDetail);
// updating store
this.close();
},
});
所以如你所见,我需要在这里调用网格和更新,但我想成为通用窗口。因此,我需要使用保存按钮,以便触发某些事件,但不能在wind.js
中触发