fix NodeSelector

This commit is contained in:
Dietmar Maurer 2013-04-24 09:50:10 +02:00
parent 0ee3bc7a67
commit 04a3ef7ac7
2 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,9 @@ Ext.define('PVE.form.ComboGrid', {
extend: 'Ext.form.field.ComboBox', extend: 'Ext.form.field.ComboBox',
alias: ['widget.PVE.form.ComboGrid'], alias: ['widget.PVE.form.ComboGrid'],
// this value is used as default value after load()
preferredValue: undefined,
computeHeight: function() { computeHeight: function() {
var me = this; var me = this;
var lh = PVE.Utils.gridLineHeigh(); var lh = PVE.Utils.gridLineHeigh();
@ -100,7 +103,7 @@ Ext.define('PVE.form.ComboGrid', {
me.setDisabled(false); me.setDisabled(false);
} }
var def = me.getValue(); var def = me.getValue() || me.preferredValue;
if (def) { if (def) {
me.setValue(def, true); // sync with grid me.setValue(def, true); // sync with grid
} }

View File

@ -80,7 +80,7 @@ Ext.define('PVE.form.NodeSelector', {
}); });
if (me.selectCurNode && PVE.curSelectedNode.data.node) { if (me.selectCurNode && PVE.curSelectedNode.data.node) {
me.value = PVE.curSelectedNode.data.node; me.preferredValue = PVE.curSelectedNode.data.node;
} }
me.callParent(); me.callParent();