PDA

View Full Version : Add Listener to RowGrid comboBox



hyps
17 Dec 2010, 2:00 AM
hello,

I have a RowEditor Grid with two combo-boxes and need to reload the store of combobox2 depending on the selected value of combobox1.

I already searched, but I just couldn't find anything for that specific problem.

This is what I have so far:


grid.getSelectionModel().on('rowselect', function(sm, rowIdx, r) {
var action = r.data.combo1
combo2Store.reload({params:{action:action}});
});


This code will reload the store of combobox2 with the given parameters.
Now I just would like to know how I can add a listener, that will get the value of combo1, when the "select" or "change" of combo1 fires.

Does anybody know a solution?:)

hyps
20 Dec 2010, 6:25 AM
I finally figured it out. If somebody else hast the same problem, here is an (maybe not elegant) solution.



grid.getSelectionModel().on('rowselect', function(sm, rowIdx, r) {

var combo1 = grid.getColumnModel().getCellEditor(<--idOfColumn--> , rowIdx).field;
combo1.addListener('select', functionXYZ);
});