mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-26 01:15:07 +00:00
ui: guest selector: make the shown picker columns customizable
We will reuse this component in other place, which might not always want to show all columns Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
5ea98762aa
commit
66a38a6afa
@ -22,7 +22,8 @@ Ext.define('PVE.form.VMSelector', {
|
|||||||
value: /lxc|qemu/,
|
value: /lxc|qemu/,
|
||||||
}],
|
}],
|
||||||
},
|
},
|
||||||
columns: [
|
|
||||||
|
columnsDeclaration: [
|
||||||
{
|
{
|
||||||
header: 'ID',
|
header: 'ID',
|
||||||
dataIndex: 'vmid',
|
dataIndex: 'vmid',
|
||||||
@ -94,6 +95,9 @@ Ext.define('PVE.form.VMSelector', {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
// should be a list of 'dataIndex' values, if 'undefined' all declared columns will be included
|
||||||
|
columnSelection: undefined,
|
||||||
|
|
||||||
selModel: {
|
selModel: {
|
||||||
selType: 'checkboxmodel',
|
selType: 'checkboxmodel',
|
||||||
mode: 'SIMPLE',
|
mode: 'SIMPLE',
|
||||||
@ -155,6 +159,12 @@ Ext.define('PVE.form.VMSelector', {
|
|||||||
initComponent: function() {
|
initComponent: function() {
|
||||||
let me = this;
|
let me = this;
|
||||||
|
|
||||||
|
let columns = me.columnsDeclaration.filter((column) =>
|
||||||
|
me.columnSelection ? me.columnSelection.indexOf(column.dataIndex) !== -1 : true,
|
||||||
|
).map((x) => x);
|
||||||
|
|
||||||
|
me.columns = columns;
|
||||||
|
|
||||||
me.callParent();
|
me.callParent();
|
||||||
|
|
||||||
if (me.nodename) {
|
if (me.nodename) {
|
||||||
|
Loading…
Reference in New Issue
Block a user