pve-manager/www/manager6/form/GroupSelector.js
Dominik Csapak 3f8ba9eb56 htmlEncode some comment fields
this adds Ext.String.htmlEncode as renderer
for some comment/description fields

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-06-09 17:40:03 +02:00

56 lines
909 B
JavaScript

Ext.define('PVE.form.GroupSelector', {
extend: 'PVE.form.ComboGrid',
alias: ['widget.pveGroupSelector'],
allowBlank: false,
autoSelect: false,
valueField: 'groupid',
displayField: 'groupid',
listConfig: {
columns: [
{
header: gettext('Group'),
sortable: true,
dataIndex: 'groupid',
flex: 1
},
{
header: gettext('Comment'),
sortable: false,
dataIndex: 'comment',
renderer: Ext.String.htmlEncode,
flex: 1
}
]
},
initComponent: function() {
var me = this;
var store = new Ext.data.Store({
model: 'pve-groups'
});
Ext.apply(me, {
store: store
});
me.callParent();
store.load();
}
}, function() {
Ext.define('pve-groups', {
extend: 'Ext.data.Model',
fields: [ 'groupid', 'comment' ],
proxy: {
type: 'pve',
url: "/api2/json/access/groups"
},
idProperty: 'groupid'
});
});