Need help to format this data

[quote=“jemz, post:17, topic:230706, full:true”]
Thank you again it display properly, I just notice when I tried to run the data in your example after the page load. the check box will not automatically be checked even it has status of 1.[/quote]

Currently it is not known by me how the checkboxes integrate with the tree data. It should take just a few tweaks to get things meshing together.

For example, from what I’m seeing on the dynatree samples page, the syntax is:

{title: "item2: selected on init", select: true },

This should mean that instead of:

{
    ...,
    access: 1
}

that the following is more likely to work:

{
    ...,
    select: true
}

Which can be done with just one minor change. Rename access to select and test if the value equals 1:

//access: getAccess(opts.sourceData.allowrole, roleInfo.id) || 0
select: getAccess(opts.sourceData.allowrole, roleInfo.id) === 1

If you have a test page, further troubleshooting can take place from there.