or
I was trying to implement Kendodropdowntree , I came across following situation which I am not able to understand
$(dropdowntree).kendoDropDownTree({
placeholder: "Select ...",
height: "auto",
dataSource: //HARD CODED VALUE GOES HERE
});
}
Above example will work fine when , I hard code those datasource values. When I try to pass some variable there it will not work
var datatobind= somedata // data in exact format it is expected
{
$(dropdowntree).kendoDropDownTree({
placeholder: "Select ...",
height: "auto",
dataSource: datatobind
});
}
Even I tried passing variable of following type
var dataSourcetype = new kendo.data.HierarchicalDataSource({
data: datatobind
});
{
$(dropdowntree).kendoDropDownTree({
placeholder: "Select ...",
height: "auto",
dataSource: dataSourcetype.options.data
});
}
But even above also doesn't solve problem, I am not able to get it , why passing exact same variable is not binding to data source.
$("#dropdowntree").kendoDropDownTree({
dataSource: {
type: "aspnetmvc-ajax",
transport: {
read: { url: "xxxxxxxxxxxxxxxxxxxxxxxxxxx" , data: forgeryToken, dataType: "json" }
}}
thank you