pmg-gui/js/MailProxyPorts.js
Dominik Csapak 00564597e5 execute stopUpdate on 'deactivate'
when we have a panel/grid with an updatestore which starts
on activation, we also have to stop it on deactivation,
otherwise those stores gets updated even when we are on another tab

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-10-09 06:38:04 +02:00

57 lines
1.1 KiB
JavaScript

Ext.define('PMG.MailProxyPorts', {
extend: 'Proxmox.grid.ObjectGrid',
alias: ['widget.pmgMailProxyPorts'],
url: '/api2/json/config/mail',
monStoreErrors: true,
editorConfig: {
url: '/api2/extjs/config/mail',
},
interval: 5000,
cwidth1: 200,
controller: {
xclass: 'Ext.app.ViewController',
onEdit: function() {
this.getView().run_editor();
}
},
listeners: {
itemdblclick: 'onEdit',
},
tbar: [
{
text: gettext('Edit'),
xtype: 'proxmoxButton',
disabled: true,
handler: 'onEdit'
}
],
initComponent : function() {
var me = this;
me.add_integer_row('ext_port', gettext('External SMTP Port'),
{ defaultValue: 26, deleteEmpty: true,
minValue: 1, maxValue: 65535 });
me.add_integer_row('int_port', gettext('Internal SMTP Port'),
{ defaultValue: 25, deleteEmpty: true,
minValue: 1, maxValue: 65535 });
me.callParent();
me.on('activate', me.rstore.startUpdate);
me.on('destroy', me.rstore.stopUpdate);
me.on('deactivate', me.rstore.stopUpdate);
}
});