ext6migrate: fix dropboxes in Storage Edit windows

we fix this by moving the static configuration (especially value and
displayfield) to the class definition

also we remove the scrollbar hack (it works properly now)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2016-03-10 11:46:56 +01:00 committed by Dietmar Maurer
parent 3f90858ace
commit c2317525f0
6 changed files with 44 additions and 104 deletions

View File

@ -4,6 +4,13 @@ Ext.define('PVE.storage.GlusterFsScan', {
queryParam: 'server',
valueField: 'volname',
displayField: 'volname',
matchFieldWidth: false,
listConfig: {
loadingText: 'Scanning...',
width: 350
},
doRawQuery: function() {
},
@ -42,21 +49,6 @@ Ext.define('PVE.storage.GlusterFsScan', {
Ext.apply(me, {
store: store,
valueField: 'volname',
displayField: 'volname',
matchFieldWidth: false,
listConfig: {
loadingText: 'Scanning...',
listeners: {
// hack: call setHeight to show scroll bars correctly
refresh: function(list) {
var lh = PVE.Utils.gridLineHeigh();
var count = store.getCount();
list.setHeight(lh * ((count > 10) ? 10 : count));
}
},
width: 350
}
});
me.callParent();

View File

@ -3,7 +3,13 @@ Ext.define('PVE.storage.IScsiScan', {
alias: 'widget.pveIScsiScan',
queryParam: 'portal',
valueField: 'target',
displayField: 'target',
matchFieldWidth: false,
listConfig: {
loadingText: gettext('Scanning...'),
width: 350
},
doRawQuery: function() {
},
@ -42,21 +48,6 @@ Ext.define('PVE.storage.IScsiScan', {
Ext.apply(me, {
store: store,
valueField: 'target',
displayField: 'target',
matchFieldWidth: false,
listConfig: {
loadingText: gettext('Scanning...'),
listeners: {
// hack: call setHeight to show scroll bars correctly
refresh: function(list) {
var lh = PVE.Utils.gridLineHeigh();
var count = store.getCount();
list.setHeight(lh * ((count > 10) ? 10 : count));
}
},
width: 350
}
});
me.callParent();

View File

@ -1,7 +1,10 @@
Ext.define('PVE.storage.VgSelector', {
extend: 'Ext.form.field.ComboBox',
alias: 'widget.pveVgSelector',
valueField: 'vg',
displayField: 'vg',
queryMode: 'local',
editable: false,
initComponent : function() {
var me = this;
@ -20,20 +23,8 @@ Ext.define('PVE.storage.VgSelector', {
Ext.apply(me, {
store: store,
valueField: 'vg',
displayField: 'vg',
queryMode: 'local',
editable: false,
listConfig: {
loadingText: gettext('Scanning...'),
listeners: {
// hack: call setHeight to show scroll bars correctly
refresh: function(list) {
var lh = PVE.Utils.gridLineHeigh();
var count = store.getCount();
list.setHeight(lh * ((count > 10) ? 10 : count));
}
}
}
});
@ -46,7 +37,11 @@ Ext.define('PVE.storage.BaseStorageSelector', {
alias: 'widget.pveBaseStorageSelector',
existingGroupsText: gettext("Existing volume groups"),
queryMode: 'local',
editable: false,
value: '',
valueField: 'storage',
displayField: 'text',
initComponent : function() {
var me = this;
@ -78,11 +73,6 @@ Ext.define('PVE.storage.BaseStorageSelector', {
Ext.apply(me, {
store: store,
queryMode: 'local',
editable: false,
value: '',
valueField: 'storage',
displayField: 'text'
});
me.callParent();

View File

@ -3,6 +3,9 @@ Ext.define('PVE.storage.TPoolSelector', {
alias: 'widget.pveTPSelector',
queryParam: 'vg',
valueField: 'lv',
displayField: 'lv',
editable: false,
doRawQuery: function() {
},
@ -42,19 +45,8 @@ Ext.define('PVE.storage.TPoolSelector', {
Ext.apply(me, {
store: store,
valueField: 'lv',
displayField: 'lv',
editable: false,
listConfig: {
loadingText: gettext('Scanning...'),
listeners: {
// hack: call setHeight to show scroll bars correctly
refresh: function(list) {
var lh = PVE.Utils.gridLineHeigh();
var count = store.getCount();
list.setHeight(lh * ((count > 10) ? 10 : count));
}
}
}
});
@ -66,6 +58,10 @@ Ext.define('PVE.storage.BaseVGSelector', {
extend: 'Ext.form.field.ComboBox',
alias: 'widget.pveBaseVGSelector',
valueField: 'vg',
displayField: 'vg',
queryMode: 'local',
editable: false,
initComponent : function() {
var me = this;
@ -84,20 +80,8 @@ Ext.define('PVE.storage.BaseVGSelector', {
Ext.apply(me, {
store: store,
valueField: 'vg',
displayField: 'vg',
queryMode: 'local',
editable: false,
listConfig: {
loadingText: gettext('Scanning...'),
listeners: {
// hack: call setHeight to show scroll bars correctly
refresh: function(list) {
var lh = PVE.Utils.gridLineHeigh();
var count = store.getCount();
list.setHeight(lh * ((count > 10) ? 10 : count));
}
}
}
});

View File

@ -4,6 +4,13 @@ Ext.define('PVE.storage.NFSScan', {
queryParam: 'server',
valueField: 'path',
displayField: 'path',
matchFieldWidth: false,
listConfig: {
loadingText: gettext('Scanning...'),
width: 350
},
doRawQuery: function() {
},
@ -42,21 +49,6 @@ Ext.define('PVE.storage.NFSScan', {
Ext.apply(me, {
store: store,
valueField: 'path',
displayField: 'path',
matchFieldWidth: false,
listConfig: {
loadingText: gettext('Scanning...'),
listeners: {
// hack: call setHeight to show scroll bars correctly
refresh: function(list) {
var lh = PVE.Utils.gridLineHeigh();
var count = store.getCount();
list.setHeight(lh * ((count > 10) ? 10 : count));
}
},
width: 350
}
});
me.callParent();

View File

@ -1,7 +1,13 @@
Ext.define('PVE.storage.ZFSPoolSelector', {
extend: 'Ext.form.field.ComboBox',
alias: 'widget.pveZFSPoolSelector',
valueField: 'pool',
displayField: 'pool',
queryMode: 'local',
editable: false,
listConfig: {
loadingText: gettext('Scanning...'),
},
initComponent : function() {
var me = this;
@ -20,21 +26,6 @@ Ext.define('PVE.storage.ZFSPoolSelector', {
Ext.apply(me, {
store: store,
valueField: 'pool',
displayField: 'pool',
queryMode: 'local',
editable: false,
listConfig: {
loadingText: gettext('Scanning...'),
listeners: {
// hack: call setHeight to show scroll bars correctly
refresh: function(list) {
var lh = PVE.Utils.gridLineHeigh();
var count = store.getCount();
list.setHeight(lh * ((count > 10) ? 10 : count));
}
}
}
});
me.callParent();