PDA

View Full Version : TriggerField as Grid Editor



kurtybain
9 Nov 2010, 4:37 PM
Hi, I hope you can help me with this issue.

Ive created my custom grid editor which can set 3 different values in a cell: a date, 'OK' and 'N/A'. When the trigger field's button is pressed, a menu appears with three buttons, each one for each possible value.

So far Ive achieved to do this as a separate component, without integrating it to the grid , and it works
fine, but once in the editable grid, after the menu pops up and one of the three buttons is pressed, the value isn't
set in the field/cell.

This is the code of my custom field.


Ext.ns('Ext.ux.form');
Ext.ux.form.ConfigField = Ext.extend(Ext.form.TriggerField, {
initComponent : function(){
Ext.ux.form.ConfigField.superclass.initComponent.call(this);
},
triggerClass:'x-form-config-trigger',
width:180,
hasOk:true,
hasNA:true,
setValue : function(text){
Ext.ux.form.ConfigField.superclass.setValue.call(this, text);
},
onTriggerClick : function(a){
var elem = this;
new Ext.menu.Menu({
items:[
new Ext.Button({
text:'Fecha',
handler:function(){
elem.setValue("FECHA");
}
}),
new Ext.Button({
text:'OK',
handler:function(){
elem.setValue("OK");
}
}),
new Ext.Button({
text:'N/A',
handler:function(){
elem.setValue("N/A");
}
})
]
}).showAt(a.getXY());
}
})


Hope you can help me with this, thanks in advance.