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

setDataSource is not a function

3 Answers 112 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Princess
Top achievements
Rank 1
Princess asked on 12 Dec 2012, 03:44 AM
I'm very clueless on this error. Here is my scenario, every time the user selects a value on the combobox, I needed to repopulate the treeview. The error is "setDataSource is not a function". 

//populate tree view base on the site selected
            var params = new Object();
            params.siteid = site.value();

            var jsondata = $.param(params);

            $.ajax({
                type: "GET",
                url: "/Maintenance/ProjectFolderListBySite",
                data: jsondata,
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (result) {

                    var nodes = $.parseJSON(result.d);

                    var ds = new kendo.data.HierarchicalDataSource({
                        data: nodes,
                        schema: {
                            model:
                            {
                                id:"id",
                                parentid:"ParentID",
                                name:"Name",
                                siteid:"SiteID",
                                hasChildren:"hasChildren",
                                detailfolder:"DetailFolder"
                            }
                        }
                    });

                    $("#treeview").data("kendoTreeView").setDataSource(ds);

                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert(textStatus);
                }
            }); 

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 14 Dec 2012, 11:04 AM
Hello Princess,

 
I will need a repro project. As you are going to prepare a simple test project for the support thread opened on the same subject, I will ask you to continue our conversation there.

Regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Princess
Top achievements
Rank 1
answered on 15 Dec 2012, 01:52 AM
@Georgi

Sorry for the duplicate ticket. I was able to solve this solution. Thanks anyway!
0
Sreejith
Top achievements
Rank 1
answered on 18 Sep 2015, 09:30 PM
What was the solution ?
Tags
TreeView
Asked by
Princess
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Princess
Top achievements
Rank 1
Sreejith
Top achievements
Rank 1
Share this question
or