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

here is the question , how can i get the attr from the json datasource ?

1 Answer 41 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
tao
Top achievements
Rank 1
tao asked on 02 May 2013, 04:06 AM
A kendo TreeView like this ,

$("#treeview").kendoTreeView({
                       dataSource: [
                           { text: "Furniture", expanded: true, items: [
                               { text: "Tables & Chairs",actionDirect:"doSomething",jsFunc:"func1" },
                               { text: "Sofas",actionDirect:"doSomething",jsFunc:"func2" },
                               { text: "Occasional Furniture",actionDirect:"doSomething",jsFunc:"func3" }
                           ] },
                           { text: "Decor", items: [
                               { text: "Bed Linen",actionDirect:"doSomething",jsFunc:"func4" },
                               { text: "Curtains & Blinds",actionDirect:"doSomething",jsFunc:"func5" },
                               { text: "Carpets",actionDirect:"doSomething",jsFunc:"func6" }
                           ] },
                           { text: "Storage",actionDirect:"doSomething",jsFunc:"func7" }
                       ],
                       select: onSelect,
                       dataUrlField: "actionDirect",
                   });

i want to do an ajax request, but i need get the ATTR "jsFunc" callback function after ,  how can i get it ?

1 Answer, 1 is accepted

Sort by
0
tao
Top achievements
Rank 1
answered on 02 May 2013, 05:34 AM
ok , i got it 


var data = $('#treeview').data('kendoTreeView').dataItem(e.node);
alert(data.jsFunc);

thx , guys
Tags
TreeView
Asked by
tao
Top achievements
Rank 1
Answers by
tao
Top achievements
Rank 1
Share this question
or