Error Uncaught TypeError: e.slice is not a function

2 posts, 0 answers
  1. Ali
    Ali avatar
    1 posts
    Member since:
    Sep 2012

    Posted 22 Mar 2016 Link to this post

    Hi KendoUI Team,

    I'm using Kendo Grid, but found and error

    Uncaught TypeError: e.slice is not a function

     

    01.var data = new kendo.data.DataSource({
    02.            transport: {
    03.                read: {
    04.                    url: "/admin/api/tenant/list",
    05.                },
    06.                schema: {
    07.                    data: "list",
    08.                    total: "total"
    09.                }
    10.            }
    11.        });
    12. 
    13.        $scope.gridOptions = {
    14.            sortable: true,
    15.            pageable: true,
    16.            dataSource: data,
    17.            height: 350,
    18.            sortable: true,
    19.            selectable: "row",
    20.            columns: [
    21.                {
    22.                    field: "tenant_code",
    23.                    title: "Tenant Code"
    24.                }, {
    25.                    field: "tenant_name",
    26.                    title: "Tenant Name"
    27.                }
    28.            ]
    29.        };

    The JSON Response is something like this

    {"list":[{"tenant_id":10,"tenant_code":"PX","description":"PX","tenant_key":"cf4f483867e0c770dda73062a492b370","tenant_name":"PX","email":"admin@px.com","host":"","create_datetime":"20150729163732","create_user_id":-1,"update_datetime":"20150729163732","update_user_id":-1,"version":0,"active":"Y","active_datetime":"20150729163732","non_active_datetime":" "},{"tenant_id":11,"tenant_code":"ST","description":"ST","tenant_key":"d41d8cd98f00b204e9800998ecf8427e","tenant_name":"ST","email":"admin@st.com","host":"www.st.com","create_datetime":"20160322035919","create_user_id":-1,"update_datetime":"20160322035919","update_user_id":-1,"version":0,"active":"Y","active_datetime":"20160322035919","non_active_datetime":" "}],"total":2}
  2. Rosen
    Admin
    Rosen avatar
    3253 posts

    Posted 23 Mar 2016 Link to this post

    Hello Ali,

    The behavior is caused as the dataSource.schema configuration is incorrectly placed inside the dataSource.transport. Moving it to a top-level setting of the DataSource should fix the issue.

    Regards,
    Rosen
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top