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

Getting error when trying to sort

3 Answers 145 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
Lee asked on 08 Jul 2020, 09:53 PM

I am trying to sort my grid. Nothing happens and I'm getting the following console error: 

kendo.all.js:164 Uncaught TypeError: r[n].call is not a function
    at init.trigger (VM376 kendo.all.min.js:25)
    at init.d (VM376 kendo.all.min.js:61)
    at init.trigger (VM376 kendo.all.min.js:25)
    at init._click (VM376 kendo.all.min.js:54)
    at HTMLTableCellElement.d (jquery-1.12.3.min.js:2)
    at HTMLTableCellElement.dispatch (jquery-1.12.3.min.js:3)
    at HTMLTableCellElement.r.handle (jquery-1.12.3.min.js:3)

I created this Dojo to duplicate the problem: https://dojo.telerik.com/@dojolee/AFEqOfiZ

3 Answers, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 10 Jul 2020, 10:23 AM

Hi Lee,

The reason for the issue is that the 'sort' configuration is not inserted in the dataSource configuration of the Grid. 

Here is an edited version of the provided Dojo. The below snippet demonstrates the correct position of the "sort" configuration.

    dataSource: {
      data: reportData.items,
      sort: {
        field: "itemID",
        dir: "asc"
      },
      schema: {
      .....................................

Regards,
Petar
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.
0
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
answered on 10 Jul 2020, 01:48 PM
That fixed it. I love when the fix is this simple. 
0
Petar
Telerik team
answered on 14 Jul 2020, 08:08 AM

Hi Lee,

I am happy that the provided solution has helped you!

Regards,
Petar
Progress Telerik

Tags
Grid
Asked by
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
Answers by
Petar
Telerik team
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
Share this question
or