Ben Emanuel
Ben Emanuel

Reputation: 13

Kendo UI PanelBar using dataSource giving stack overflow js error

When I use the following code (returning JSON from URL):

<ul id="vacancies"/>

<script>
    
        var dataSource = new kendo.data.DataSource({
            transport: {
                read: {
                    url: "/MemberBack/GetVacancies",
                    dataType: "json"
                }
            },
            schema: {
                model: {
                    id: "VacancyId",
                    hasChildren: false
                }
            }
        });

        $('#vacancies').kendoPanelBar({
            dataSource: dataSource
        });
    
    
</script>

I get:

enter image description here

It is definately calling the serverside which is returning the List, it only errors when I try to bind it.

Upvotes: 0

Views: 103

Answers (1)

Ceco Milchev
Ceco Milchev

Reputation: 407

The PanelBar internally works with a HierarchicalDataSource. I have noticed that you have set the flat DataSource instead. Update the DataSource to a HierarchicalDataSource:

var dataSource = new kendo.data.HierarchicalDataSource

Here is an updated example:

Dojo

Upvotes: 1

Related Questions