}
});
+ var render_errors = function(value, metaData, record) {
+ var errors = record.data.errors;
+ if (errors) {
+ var msg = errors.cidr || errors.nomatch;
+ if (msg) {
+ metaData.tdCls = 'x-form-invalid-field';
+ var html = '<p>' + Ext.htmlEncode(msg) + '</p>';
+ metaData.tdAttr = 'data-qwidth=600 data-qtitle="ERROR" data-qtip="' +
+ html.replace(/\"/g,'"') + '"';
+ }
+ }
+ return value;
+ };
+
Ext.apply(me, {
tbar: [ '<b>IP/CIDR:</b>', me.addBtn, me.removeBtn, me.editBtn ],
store: store,
dataIndex: 'cidr',
width: 150,
renderer: function(value, metaData, record) {
+ value = render_errors(value, metaData, record);
if (record.data.nomatch) {
return '<b>! </b>' + value;
}
Ext.define('pve-ipset', {
extend: 'Ext.data.Model',
fields: [ { name: 'nomatch', type: 'boolean' },
- 'cidr', 'comment' ],
+ 'cidr', 'comment', 'errors' ],
idProperty: 'cidr'
});