2 problems with "Editable items" in tree

Hello,



We have the professional version of dhtmlx2.1.



The first problem:

Double clicking on an editable item will close the selected item.



dhtmlx.com/docs/products/dht … _edit.html

- open the item “Books”

- double click this item and it will be closed :frowning:

This problem does not exist in version “dhtmlxTree_v13_pro_61020”.



The second problem:

“tree.setChildCalcMode(“childrec”);”



If you edit (double click) an item without a child, the parent item counter raises by 1 for this item.



Would you kindly help me, please.



Best regards,

Stefan Renneke


Hello,


by default tree nodes can be opened/closed by double click. In order to disable this action you can try to use onDblClick event handler:


tree.attachEvent(“onDblClick”,function(id){


return false


})


The issue with tree.setChildCalcMode(“childrec”); is confirmed and fixed.


Please, contact us at support@dhtmlx.com, provide your ref number - and we’ll send you the fix.


It works well.



Thanks for the help.


I habe the next problem with “tree.setChildCalcMode(“childrec”);” and “Double clicking on an editable item”.



I wanna compare the item value before and after editing.



In stage 0 of the “onEdit” - event the value of editor contains the “[numer of all childs]”, but “ChildCalcMode” is not a part of the item text attribute!



Can you help me, please?


Hello,


The fourth parameter of the onEdit handler (value) is innerHTML of edited item. Calculating number is part of this html.


To exclude it you can apply the following replacement:


value = value.replace(/[[^]]*]/,"");