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

Sort Grid Initialized from HTML Table

4 Answers 177 Views
Grid
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 20 Nov 2012, 07:31 PM
Is it possible to implement sorting when the Grid is initialized from a HTML table?  I am just looking for an example of this, assuming it is possible to do.  Thanks.

William Wade

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 21 Nov 2012, 12:41 PM
Hi William,

Yes, sorting of a Grid, which is created from an existing <table>, is possible. The widget creates a Kendo UI dataSource instance and fills it with the data from the table cells. Later on, this dataSource executes the data operations and populates the Grid. However, you should keep in mind that by default, all data fields will be of a string type and may not be sorted as expected, unless you specify a schema with a model.

Greetings,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
William
Top achievements
Rank 1
answered on 21 Nov 2012, 02:30 PM
I set sortable to true, but nothing happens when I click on the column headers. 
$("#grid").kendoGrid({
    height:500,
    sortable:true
});
I don't think there is anything special about my table.  Thanks.

William Wade
0
Dimo
Telerik team
answered on 21 Nov 2012, 05:02 PM
Hello William,

Please check for Javascript errors. If you don't have any, please provide a runnable jsFiddle / jsBin demo, which reproduces the problem.

All the best,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
William
Top achievements
Rank 1
answered on 06 Dec 2012, 05:30 PM
Sorry to take so long in replying.  The issue was my version of KendoUI (discovered when building the fiddler example).  I upgraded to the latest build and it works.  Thanks.

Wade

Tags
Grid
Asked by
William
Top achievements
Rank 1
Answers by
Dimo
Telerik team
William
Top achievements
Rank 1
Share this question
or