ext6migrate: adapt the Checkbox column of the firewall panel to ExtJS6

API changes in ExtJS6 involved here:
 * 'checkchange' event passes now the record index instead of the whole record
 * record.fields is now an array of Field objects, before it was an Object
This commit is contained in:
Emmanuel Kasper 2016-01-28 14:42:43 +01:00 committed by Dietmar Maurer
parent 85203d5bea
commit 7a4c3133bc

View File

@ -623,10 +623,11 @@ Ext.define('PVE.FirewallRules', {
header: gettext('Enable'),
dataIndex: 'enable',
listeners: {
checkchange: function(column, record, checked) {
checkchange: function(column, recordIndex, checked) {
var record = me.getStore().getData().items[recordIndex];
record.commit();
var data = {};
record.fields.each(function(field) {
Ext.Array.forEach(record.getFields(), function(field) {
data[field.name] = record.get(field.name);
});
if (!me.allow_iface || !data.iface) {