Categories | Question details Back To List | ||
tree.setChildCalcMode("leafsrec") Hi, I am very new person for this one. I have a doubt regarding retrieving the child item count. I could not get the count of items. I have tried all combination of modes, but i am getting "undefined" value. I am using like tree.setChildCalcMode("leafsrec"); or tree.setChildCalcMode("child"); Kindly help me. Regards, Suba Paul Answer posted by Alex (support) on Apr 30, 2009 06:48 Hello, This issue can be caused by using setChildCalcHTML. This method requires the left and right html templates as the parameters. If you just set tree.setChildCalcHTML(""), the described issue occurs. The example of correct usage is: tree.setChildCalcMode("leafsrec"); If the issue still isn't resolved, please provide any sample to reproduce the problem. Answer posted by Subathra on May 05, 2009 23:44 Hi Alex, We bought this professional edition. I am using setChildCalcMode only, but i am getting the same error. Herewith i have enclosed the my sample programme. Kindly help me. Thanks & Regards, Suba Paul Answer posted by Alex (support) on May 06, 2009 00:42 Hello Subathra, setChildCalcMode displays the number of child items next to the parent. This method doesn't return anything. It should be called before data adding. Please, try to do the following: ... We have removed your attachment - it contained files from PRO edition. Answer posted by Subathra on May 06, 2009 01:39 Hi Alex, Thanks a lot. But i want that count while retrieving the data from tree and store it into db. What should i do? Thanks & Regards, Subathra Answer posted by Alex (support) on May 06, 2009 02:29 You can try to use one of the following approaches depending on item count you want to get: 1) hasChildren(itemId) method - returns the number of nearest child nodes ( from the next level): var count = tree.hasChildren(0) - the number of items on 1st level 2) getAllSubItems(itemId) returns the list of all child items: var list = tree.getAllSubItems(0); var arr = list.split(","); var count = arr.length; |