setDataSource is not a function

4 posts, 0 answers
  1. Princess
    Princess avatar
    11 posts
    Member since:
    Feb 2012

    Posted 11 Dec 2012 Link to this post

    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);
                    }
                }); 
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 14 Dec 2012 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Princess
    Princess avatar
    11 posts
    Member since:
    Feb 2012

    Posted 14 Dec 2012 Link to this post

    @Georgi

    Sorry for the duplicate ticket. I was able to solve this solution. Thanks anyway!
  5. Sreejith
    Sreejith avatar
    4 posts
    Member since:
    Jan 2013

    Posted 18 Sep 2015 in reply to Princess Link to this post

    What was the solution ?
Back to Top
Kendo UI is VS 2017 Ready