mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-08-10 18:27:52 +00:00
button: make xtype of parent configurable
to get the selection model of the parent, we use by default the xtype 'grid', but sometimes we want to use something else (e.g. 'treepanel') to be flexible we make this configurable Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
8617feb8fc
commit
335b5f3747
@ -20,6 +20,9 @@ Ext.define('Proxmox.button.Button', {
|
||||
// take special care in confirm box (select no as default).
|
||||
dangerous: false,
|
||||
|
||||
// is used to get the parent container for its selection model
|
||||
parentXType: 'grid',
|
||||
|
||||
initComponent: function() {
|
||||
var me = this;
|
||||
|
||||
@ -65,9 +68,9 @@ Ext.define('Proxmox.button.Button', {
|
||||
|
||||
var grid;
|
||||
if (!me.selModel && me.selModel !== null && me.selModel !== false) {
|
||||
grid = me.up('grid');
|
||||
if (grid && grid.selModel) {
|
||||
me.selModel = grid.selModel;
|
||||
parent = me.up(me.parentXType);
|
||||
if (parent && parent.selModel) {
|
||||
me.selModel = parent.selModel;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user