Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by N.darques on Feb 25, 2008 10:30
open dhtmlx forum
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 :

...
<row id="day|2008-02-21" style="background:#cde4dc">
<cell image="plus_ar.gif">Jeu 21/02</cell>
    <row id="user_wd|5">
<cell image="leaf.gif">Task 1</cell>
<cell>1</cell>
<cell>day</cell>
<cell>16</cell>
    <cell xmlcontent="2">
    <complete>
<option value="6">AIRPORT</option>
</complete>
</cell>
<cell>102FCGI_A060</cell>
</row>
</row>
...

and I double checked my js files loaded.

I'm a bit stuck. Any thought ?
Answer posted by Support on Feb 26, 2008 05:39
>> 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
Attachments (1)