dhtmlxcombo in a dhtmlxtreegrid (1.6 suite)

I’m currently trying to settle a small application involving a treegrid component with a custom per cell selectbox for 2 columns.



As thoses custom select box need to be updated when value of on another column of the same row is changed, I first tried to setup a customCombo on the fly like this :



function onEditCell(editStep,rowId,cellIndex,newValue,oldValue) {

    switch (editStep) {

            case 0:

                var combo=mygrid.getCustomCombo(rowId,4);

                combo.clear();

// … For the sakle I simplify code here but basically upon value of cellById(rowId,3) I fill select box…

                combo.put(-1,“Please Select…”);

                combo.put(5,“AIRPORT”);

// … list goes on…

            break;





It occurs that, first time I edit this combo box, It’s not updated and still have old key/values, and then if I edit a second time, new values appears, old values still there too. Then again, I edit another time, having previously selected a new value, old values finally disappears.





Then , I reckoned that I might need some ajax update (need to get values from a mysql server), so I tried instead to set up a dhtmxCombo in thoses columns which would be feeded firstly by a xml file and then update on edit.

Unfortunatly, I never managed to integrate properly a dhtmlxcombo in my dhtmlxtreegrid.



I’m getting this error : ‘columns[this.cell._cellIndex] has no properties’.

My xml init file seems to be valid :







Jeu 21/02

    

Task 1

1

day

16

    

    

AIRPORT





102FCGI_A060









and I double checked my js files loaded.



I’m a bit stuck. Any thought ?

>> It occurs that, first time I edit this combo box, It’s not updated and still have old key/values, and then if I edit a second time, new values appears
The problem caused by using getCustomCombo instead of getCombo
In moment when onEditCell stage 0 called - cell already locked to current combo list and getCustomCombo not usable anymore
If you change code to use getCombo - it must work correctly.


>>Then , I reckoned that I might need some ajax update (need to get values from a mysql server), so I tried instead to set up a dhtmxCombo
Please check attached sample

grid_nested_combo.zip (82.6 KB)