我们有一个表单面板,它包含一个可编辑的网格和一个'保存'按钮。捕获FormPanel出口
PROJ.RWA = Ext.extend(Ext.form.FormPanel,
{
initcomponent:function(){
....
.....
var rwa_config = {
.......
tbar:rwa_tbar,
items: [
borr_grid, nonBorr_grid
],
buttons: [{
text: 'Save',
handler:this.getValues
},
.....]
.......
};
Ext.apply(this, Ext.apply(this.initialConfig, rwa_config));
PROJ.RWA.superclass.initComponent.call(this, rwa_config);
}
}
该组件从index.html的
我们需要确保用户获得一个警告时,他是从导航这个面板了,如果有在电网未保存的更改加载。
如果网格是'脏'并且'保存'尚未被点击 - 当用户正在导航到其他页面/面板时,我们应该弹出警告。
我们该怎么做?