2

I am creating dynatree. I want to set first node of dynatree to be selected on opening dynatree. I set select= tree in json for first element. but it does't work. I want to skip adding select property in json. It is better to get something on dynatree() function.

"[{"Id":16,"ParentId":0,"Parent":null,"title":"X","key":"16","isFolder":true,"select":true,"children":[{"Id":17,"ParentId":16,"Parent":null,"title":"X1,"key":"17","isFolder":true,"select":false,"children":[{"Id":35,"ParentId":17,"Parent":null,"title":"X2","key":"35","isFolder":true,"select":false,"children":[]}]}]}]"

Hemant Malpote
  • 871
  • 9
  • 25

1 Answers1

0

Maybe you are confusing 'select' with 'activate'? Try

{... "activate": true, ... 

instead. You can also call node.activate() for a node in the onPostInit event.

mar10
  • 11,918
  • 5
  • 35
  • 58
  • But this change is in json. i want something dynatree() function. Now i am searching first node in PostInit method and setting that node to be active. – Hemant Malpote Aug 13 '15 at 09:15
  • This is what I was trying to suggest by "You can also call node.activate() for a node in the onPostInit event" :) – mar10 Aug 13 '15 at 15:52
  • That is last option. I was looking any direct method in dynatree which will do this 2 operation directly . – Hemant Malpote Aug 13 '15 at 16:04