I have 2 treegrids with drag and drop capabilities. One of the treegrids is a form that will be submitted to the server and info saved in our database.
When submiting a treegrid using forms, how do I send parent information with the child?
I’d also like to preserve the order the children are in. We are using and are not able to use dataConnector and dataProcessor.
To keep the row order we have a hidden field to store the order and we determine the order with this function. Now the order is sent with the form. I’ve posted the code to help others who might have the same question.
<input type="hidden" name="category_order" value="" />
// when data is submitted to the server iterate through the rows and determine their ordering
function finalizeData() {
var data = [];
for (var i=0; i<mygrid.getRowsNum(); i++){
var id = mygrid.getRowId(i);
data.push( id );
}
document.forms["form1"].category_order.value = data.join(",");
}
However, I still need to pair the child with their parents so for example when the form is submitted we know that children Accord and Civic are a with parent Honda.
Any ideas on sending parent information with child on form submit with treegrid?