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

Grid initial sorting does not work

2 Answers 188 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Manu
Top achievements
Rank 1
Manu asked on 01 Jul 2016, 07:37 AM

Hello,

I can find out why initial sorting does not work for:

var gridTest = $("#test-grid").kendoGrid({
    dataSource: gridDataSource(actions.search.fixTest, 100),
    sortable: true,
    pageable: false,
    scrollable: true,
    filterable: true,
    selectable: "row",
    resizable: true,
    width: 700,
    height: 630,
    columns: [
        { field: "Index", width: "60px" },
        { field: "NR", width: "60px" },
        { field: "Test", width: "400px" },
    ],
    sort: { field: "Index", dir: "desc" }
});

Everything else works fine; clicking on the column header does sorting. But no initial sorting!

Any ideas?

Best regards,

Manu

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 01 Jul 2016, 03:43 PM
Hi,

You are defining the sort line in the wrong place. You're putting it as one of the grid properties, but it is a datasource property. Below you can find a simple example with initial sorted column in the grid
http://dojo.telerik.com/ExigI/8

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Manu
Top achievements
Rank 1
answered on 04 Jul 2016, 11:32 AM

Thanks for the link, it helped to solve the problem.

Regards

Manu

Tags
Grid
Asked by
Manu
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Manu
Top achievements
Rank 1
Share this question
or