PDA

View Full Version : Combobox in columnmodel in editorGridpanel



dragem
25 Nov 2011, 2:47 AM
I have a editorGridPanel with a combobox on a colomn. everything works but only after a other cell is clicked. is there a way to force the cell to process the data.

this is the code for the combo box

var successCombo = new Ext.form.ComboBox({ xtype: 'combo',
triggerAction: 'all',
store: comboSuccessDS,
iconCls: 'no-icon',
valueField: 'perc',
displayField: 'success_factor',
tpl:'<tpl for="."><div ext:qtip="{perc} %. {subject}"; class="x-combo-list-item">{success_factor}</div></tpl>',
allowblank: false,
resizable: true,
editable: false,
grow: true,
listeners: {
expand : function(box){
box.setWidth(200);
},
collapse : function(box){
//here i want to force the cell to process the new value
}
}
});

mitchellsimoens
25 Nov 2011, 8:52 AM
You are using it as an Editor? Not hard to do..

dragem
28 Nov 2011, 12:43 AM
You're not really helping. The value only gets saved if an other cell is clicked. what can I do?

tobiu
28 Nov 2011, 4:01 AM
basically, in your usecase the changes will get applied on the blur event -> when the active editor loses focus.

it is also possible for fields to save on the keypress of enter / return, but not in your usecase since you set editable to false.

so, for an easy solution, i would allow editing and set the following 2 configs:


forceSelection: true,
typeAhead: true

dragem
28 Nov 2011, 4:49 AM
I did what you suggested but I see no change in behaviour.

dragem
28 Nov 2011, 5:41 AM
after a frustrated day i finaly got the anwser.


collapse : function(box){
box.setWidth(60);
box.fireEvent('blur');
}

I tryed it before but apparently forgot to declare what should do a fireEvent();

tnks for the help everyone