Hi i am new to kendo UI framework and trying my hands on tree view part.I am using Ajax for loading data but its not coming in Treeview format.i guess something wrong with the schema part the mapping is not correct ,i don't know how to map it exactly.Can anyone help me in this.right now i am able to load kendo tree using the local data.how can i convert this into remote data binding...???? here is my code:
public class EloquaTreeJSONBean {
private String id;
private String text;
private String parent;
private String type;
}.....////////// follow with getters and setters
jsp code:
var dataSource = new kendo.data.HierarchicalDataSource(
{
data : [
{
categoryName : "TransperfecttranslationPartner",imageUrl: "../resources/js/jstree/home.png",
subCategories : [
{
subCategoryName : "Emails",imageUrl: "../resources/js/jstree/email_16.png",
subCategories : [
{
subCategoryName : "Emails1.1",imageUrl: "../resources/js/jstree/email_16.png",
},
{
subCategoryName : "Emails1.2",imageUrl: "../resources/js/jstree/email_16.png",
},
{
subCategoryName : "Emails1.3",imageUrl: "../resources/js/jstree/email_16.png",
}
]
},
{
subCategoryName : "Landingpage",imageUrl: "../resources/js/jstree/eloquaLandingPageIcon.png",
subCategories : [
{
subCategoryName : "landingpage1.1" ,imageUrl: "../resources/js/jstree/eloquaLandingPageIcon.png",
},
{
subCategoryName : "landingpage1.2",imageUrl: "../resources/js/jstree/eloquaLandingPageIcon.png",
},
{
subCategoryName : "landingpage1.3",imageUrl: "../resources/js/jstree/eloquaLandingPageIcon.png",
}
]
},
{
subCategoryName : "Dynamiccontent",imageUrl: "../resources/js/jstree/dynamicContentIcon.png",
subCategories : [
{
subCategoryName : "Dynamiccontent.1",imageUrl: "../resources/js/jstree/dynamicContentIcon.png",
},
{
subCategoryName : "Dynamiccontent.2",imageUrl: "../resources/js/jstree/dynamicContentIcon.png",
},
{
subCategoryName : "Dynamiccontent.3",imageUrl: "../resources/js/jstree/dynamicContentIcon.png",
}
]
}, ]
},
],
schema : {
model : {
children : "subCategories"
}
}
});
$("#gltreegrid").kendoTreeView(
{
dataSource : dataSource,
dataTextField : [ "categoryName",
"subCategoryName" ],
checkboxes: {
checkChildren: true
},
});
public class EloquaTreeJSONBean {
private String id;
private String text;
private String parent;
private String type;
}.....////////// follow with getters and setters
jsp code:
var dataSource = new kendo.data.HierarchicalDataSource(
{
data : [
{
categoryName : "TransperfecttranslationPartner",imageUrl: "../resources/js/jstree/home.png",
subCategories : [
{
subCategoryName : "Emails",imageUrl: "../resources/js/jstree/email_16.png",
subCategories : [
{
subCategoryName : "Emails1.1",imageUrl: "../resources/js/jstree/email_16.png",
},
{
subCategoryName : "Emails1.2",imageUrl: "../resources/js/jstree/email_16.png",
},
{
subCategoryName : "Emails1.3",imageUrl: "../resources/js/jstree/email_16.png",
}
]
},
{
subCategoryName : "Landingpage",imageUrl: "../resources/js/jstree/eloquaLandingPageIcon.png",
subCategories : [
{
subCategoryName : "landingpage1.1" ,imageUrl: "../resources/js/jstree/eloquaLandingPageIcon.png",
},
{
subCategoryName : "landingpage1.2",imageUrl: "../resources/js/jstree/eloquaLandingPageIcon.png",
},
{
subCategoryName : "landingpage1.3",imageUrl: "../resources/js/jstree/eloquaLandingPageIcon.png",
}
]
},
{
subCategoryName : "Dynamiccontent",imageUrl: "../resources/js/jstree/dynamicContentIcon.png",
subCategories : [
{
subCategoryName : "Dynamiccontent.1",imageUrl: "../resources/js/jstree/dynamicContentIcon.png",
},
{
subCategoryName : "Dynamiccontent.2",imageUrl: "../resources/js/jstree/dynamicContentIcon.png",
},
{
subCategoryName : "Dynamiccontent.3",imageUrl: "../resources/js/jstree/dynamicContentIcon.png",
}
]
}, ]
},
],
schema : {
model : {
children : "subCategories"
}
}
});
$("#gltreegrid").kendoTreeView(
{
dataSource : dataSource,
dataTextField : [ "categoryName",
"subCategoryName" ],
checkboxes: {
checkChildren: true
},
});