problem of combo and grid‏

Dear knowledge base team:

I have an Enterprise dhtmlxTreeGrid (dhtmlxTreeGrid_v13_Pro_70414). I’m facing some problem with integrating combo in grid.

(Please see my program below). I have a combo in the first column of the grid. I want to copy the selected row and paste it below when I click the href “copyrow”. But there is no options in the new row.



Could you please give me some suggestions to achieve this function? Thanky very much. I’m looking forward to your reply.



Best regards



L.H.





html---------------------------------------------------------------------------------------------------------------------



copyrow












xml------------------------------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8" ?>

-

-

-

one

data.xml



loading from special xml



-

-

-

one

two

three

four

five

six

seven

eight

nine

ten





loading from grid xml








Hello,


copyRowContent method doesn’t copy the additional data (combo options in this case).


And moreover the combo excell in the grid 1.3 is not so flexible as in the latest grid (it doesn’t allow to initialize combo from JS, the data can be loaded only from grid xml). So, we recommend you to update grid to the latest one.


If it isn’t possible, you can try to use the following approach:


function copy(id,new_id){
var index = mygrid.getRowIndex(new_id);
mygrid.deleteRow(new_id); /deletes target row/
mygrid.loadXML(server_script+"?id="+id+"&new_id="+new_id,function(){ /moves loaded row to the possition of the deleted/
while(mygrid.getRowIndex(new_id)!=index)
mygrid.moveRowUp(new_id)
})
}


The server_script should return xml that contains the data from copying row but “id” attribute should be equal to new_id. For example if you want to copy 2 and paste to row1. The server-side script should return the following xml:


<?xml version="1.0" encoding="UTF-8" ?>




one
two
three
four
five
six
seven
eight
nine
ten


loading from grid xml