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

Error Uncaught TypeError: e.slice is not a function

1 Answer 1851 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ali
Top achievements
Rank 1
Ali asked on 22 Mar 2016, 10:38 AM

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}

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 23 Mar 2016, 03:09 PM

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!
 
Tags
Grid
Asked by
Ali
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or