use predefined model pve-storage-content

Else ExtJS ignores the idProperty setting.
This commit is contained in:
Dietmar Maurer 2011-11-25 12:20:53 +01:00
parent 9ce4c9707a
commit 82f58d3b5b
2 changed files with 12 additions and 15 deletions

View File

@ -41,19 +41,7 @@ Ext.define('PVE.form.FileSelector', {
var me = this;
var store = Ext.create('Ext.data.Store', {
fields: [
'volid', 'format', 'size', 'used', 'vmid',
'channel', 'id', 'lun',
{
name: 'text',
convert: function(value, record) {
if (value) {
return value;
}
return PVE.Utils.render_storage_content(value, {}, record);
}
}
]
model: 'pve-storage-content'
});
Ext.apply(me, {

View File

@ -295,7 +295,7 @@ Ext.define('PVE.storage.ContentView', {
flex: 1,
sortable: true,
renderer: PVE.Utils.render_storage_content,
dataIndex: 'volid'
dataIndex: 'text'
},
{
header: 'Format',
@ -322,7 +322,16 @@ Ext.define('PVE.storage.ContentView', {
extend: 'Ext.data.Model',
fields: [
'volid', 'content', 'format', 'size', 'used', 'vmid',
'channel', 'id', 'lun'
'channel', 'id', 'lun',
{
name: 'text',
convert: function(value, record) {
if (value) {
return value;
}
return PVE.Utils.render_storage_content(value, {}, record);
}
}
],
idProperty: 'volid'
});