I have a store that stores its values in bytes, I want the grid editor to display the column in MB.
Interaction between row editor and renderer in grid ?
So I added a renderer function to the column.
However when I enabled row editing the value that is saved to the store is MB (which the renderer function then processes into a very small number)
Is there a way to write the bytes value to the underlying store, while still preserving the MB value in the display ?
Code:
...
}, {
header: 'Minimum (MB/s)',
sortable: true,
dataIndex: 'minimum',
xtype: 'numbercolumn',
editor : {
xtype: 'numberfield'
},
renderer : function ( value, metadata, record ) {
var MBs = parseInt( value );
return MBs / ( 1024 * 1024 );
}
}, {
...
Interaction between row editor and renderer in grid ?
Aucun commentaire:
Enregistrer un commentaire