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

Uncaught TypeError: e.slice is not a function

1 Answer 2950 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 21 May 2020, 10:38 AM

Hi All,

I'm getting error "Uncaught TypeError: e.slice is not a function" on my Grid.

 

$("#gridGroupUser").kendoGrid({
     dataSource: {
         transport: {
             read: {
                 url: "https://...",
                 dataType: "json",
             }
         },
     },
     schema: {
         // The data to which the DataSource will be bound is in the "list" field of the response.
         data: "results"
     },
     height: 370,
     groupable: false,
     sortable: true,
     columns: [{
         selectable: true,
         width: 33
     }, {
         template: "<div class='user-email'><span class='k-icon k-i-user'></span> #: email #</div>",
         field: "email",
         title: "Email",
         width: 200
     }, {
         field: "firstName",
         title: "First Name",
         width: 100
     }, {
         field: "lastName",
         title: "Last Name",
         width: 100
     }, {
         field: "status",
         width: 100
     }]
 });

 

Data:

{"results":[{"userNumber":1087,"userId":"1087@noemail.com","email":"1087@noemail.com","firstName":"F1087","lastName":"L1087","status":"ACTIVE (LOCKED)","notes":"User has exceeded allowed number of failed logins (5 times). ","userType":"REGULAR USER","lastLoginDate":"2018-02-14T21:55:34.543","failedLogin":99,"expiredDate":null,"sponsorId":29,"sponsorNo":29,"sponsorCode":"scode1","sponsorName":"Sponsor1","acctMgr":"myemail1.com","acctMgrEmail":"manageremail.com","licenseCount":null,"cutoffDate":null,"lastPaymentDate":null,"billingCycle":null},{"userNumber":1594,"userId":"1594@noemail.com","email":"1594@noemail.com","firstName":"F1594","lastName":"L1594","status":"DEACTIVATED","notes":null,"userType":"REGULAR USER","lastLoginDate":"2014-06-20T15:50:30.107","failedLogin":99,"expiredDate":null,"sponsorId":29,"sponsorNo":29,"sponsorCode":"scode1","sponsorName":"Sponsor1","acctMgr":"myemail1.com","acctMgrEmail":"manageremail.com","licenseCount":null,"cutoffDate":null,"lastPaymentDate":null,"billingCycle":null}]}

 

Any idea why I'm getting this error?

Thanks!

Ryan

1 Answer, 1 is accepted

Sort by
0
Accepted
Silviya Stoyanova
Telerik team
answered on 26 May 2020, 08:08 AM

Hello Ryan,

Thank you for the provided code snippet!

I examined it and I have noticed that the schema configuration is placed outside the Datasource settings. You need to move it after the transport property.

I would also suggest adding a model into the schema, which ensures the correct adding, editing, and deleting of items.

You could also find helpful the following forum thread:

 

I hope that you will find the provided information helpful.

Kind Regards,
Silviya Stoyanova
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Silviya Stoyanova
Telerik team
Share this question
or