domingo, 26 de agosto de 2012

DhtmlGoodies - getNodeOrders method

DhtmlGoodies has a nice drag n´drop treeview component.
If you change 2 lines in method getNodeOrders (inside the script JSDragDropTree) you will be able to set up a char ID to the tree nodes. This was the only issue I encountered.

Edit the drag-drop-folder-tree.js script

inside the function getNodeOrders
,getNodeOrders : function(initObj,saveString)
...

replace this line:
var numericID = li.id.replace(/[^0-9]/gi,'');
with
var numericID = li.id;

and replace this
var numericParentID = li.parentNode.parentNode.id.replace(/[^0-9]/gi,'');
with this
var numericParentID = li.parentNode.parentNode.id;




Thats it! Now JSDrapDropTree will work with char nodes IDs.





DhtmlGoodies - http://www.dhtmlgoodies.com/