zebra
19 Jun 2012, 1:00 AM
Hi guys,
is there a way i can assign different stor for cellEditing combobox in the same column in a gridpanel??
I try to create a gridpanel that has 3 columns: brand, model, and resolution.
and user is able to change the resolution through cellEditing combobox.
however depends on brand and model, each combobox should have a different list of selection.
Im thinking just to put a different resolutionStor for each combobox when data loaded to the gridpanel.
any idea how can i do that? or other ways to achieve my goal?
thank you :D
Ext.define('myModel', {
extend: 'Ext.data.Model',
fields: [ 'brand_id','model_id', 'resolution']
});
var myStor = Ext.create('Ext.data.Store',{
storeId: 'myStor', model: 'myModel', id: 'myStor'
});
var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 });
var grid_FormatConfig =Ext.create('Ext.grid.Panel',{
id: 'grid_formatconfig',
plugins: [cellEditing],
columns: [{
header: 'brand',
dataIndex: 'brand_id',
},{
header: 'model',
dataIndex: 'model_id'
},{
header: 'resolution'
dataIndex: 'resolution',
editor: {
xtype: 'combobox',
store: resolutionStor,
displayField : 'resolution',
valueField : 'id',
queryMode : 'local',
lazyRender: true
}
}],
store: myStor
});
}
is there a way i can assign different stor for cellEditing combobox in the same column in a gridpanel??
I try to create a gridpanel that has 3 columns: brand, model, and resolution.
and user is able to change the resolution through cellEditing combobox.
however depends on brand and model, each combobox should have a different list of selection.
Im thinking just to put a different resolutionStor for each combobox when data loaded to the gridpanel.
any idea how can i do that? or other ways to achieve my goal?
thank you :D
Ext.define('myModel', {
extend: 'Ext.data.Model',
fields: [ 'brand_id','model_id', 'resolution']
});
var myStor = Ext.create('Ext.data.Store',{
storeId: 'myStor', model: 'myModel', id: 'myStor'
});
var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 });
var grid_FormatConfig =Ext.create('Ext.grid.Panel',{
id: 'grid_formatconfig',
plugins: [cellEditing],
columns: [{
header: 'brand',
dataIndex: 'brand_id',
},{
header: 'model',
dataIndex: 'model_id'
},{
header: 'resolution'
dataIndex: 'resolution',
editor: {
xtype: 'combobox',
store: resolutionStor,
displayField : 'resolution',
valueField : 'id',
queryMode : 'local',
lazyRender: true
}
}],
store: myStor
});
}