Hi everyone,
we actually found a solution for ExtJS maybe it can be adapted for GWT:
Grid-Col has an editor:
PHP Code:
{
xtype:'editorgrid',
id: 'somegrid',
store: this.store,
cm: new Ext.grid.ColumnModel([
{
id:'some_category',
header: 'Category',
dataIndex: 'category_id',
renderer: this.getCategoryText
},
{
id:'category_val',
header: 'Value',
dataIndex: 'value_id',
renderer: this.getValueText,
editor: new Ext.form.ComboBox({
id: 'value',
name: 'value',
mode: 'local',
store: this.valueStore, //this is an empty store
valueField:'value_id',
displayField:'value_text'
})
}
]),
listeners:{
beforeedit:this.getComboValues
}
}// -- eo grid
then there is a function getComboValues:
PHP Code:
function getComboValues(e){
var combobox = Ext.getCmp('value');
//create tmp store for impact levels
var tmpStore = new Ext.data.Store({
reader: new Ext.data.JsonReader({
root:'data',
id: 'value_id',
fields:['value_id','value_text']
}, Ext.data.Record.create([
{name: 'value_id'},
{name: 'value_text'}
])),
//fill here your store with the specific data for the combobox
data: e.grid.valueStore.getById(e.record.get('category_id')).data
});
//bind the tmpStore to the combobox and set the value that was selected
combobox.bindStore(tmpStore);
combobox.setValue(e.value);
return true;
}
hope i could help
greetz
vidj