This is a migrated thread and some comments may be shown as answers.

How to extract an id from the datasource and set as a div id?

0 Answers 21 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Igor
Top achievements
Rank 1
Igor asked on 13 Sep 2012, 05:50 PM
Hello

I got a datasource returning following:

[
  {"id":"1","text":"host1","spriteCssClass":"server"}
  {"id":"2","text":"host2","spriteCssClass":"server"}
]

and following code

$("#treeview-hosts").kendoTreeView({
        dragAndDrop: true,
        dataSource: {
            transport: {
                read: {
                    url: "/main/getEnvHosts",
                    type: 'POST',
                    data: '{"env":"'+env+'"}',
                }
            },
            schema: {
                model: {
                    id: "id"
                }, 
            },
        }
     
});


I need to extract the ID from DataSource and have it assigned to the element, but not entirely sure how to to that. Available documentation is rather confusing...

No answers yet. Maybe you can help?

Tags
TreeView
Asked by
Igor
Top achievements
Rank 1
Share this question
or