Onclick sort by header

exorhoogy

New Member
I am using kendo datasource to get data tables in my project, I don't want to use kendoGrid source to sort my data.I want table should sort when \[code\]Onclick\[/code\] on header.Please have a look at HTML-\[code\]<script id="template" type="text/x-kendo-template"> <tr> <td> <input type="checkbox" class="done" data-id="#= TaskID #" ></input> </td> <td> #= TaskID # </td> <td> #= Subject # </td> <td> #=AssignedTo# </td> </tr></script><div class="row-fluid"><div class="span4"> <table id="todos" class="table table-striped table-bordered"> <thead> <tr> <th>Done</th> <th>ID</th> <th>Task</th> <th>Assign To</th> </tr> </thead> <tbody> </tbody> </table> </div></div> <script>\[/code\]This is how table looks like-
cT8aM.jpg
I want table to be sorted when i click on it's headers. Like if i click ID column, it should sort this column only.Recently table is sorted by kendo UI as-\[code\] sort: { field: "TaskID", dir: "asc" }\[/code\]I don't have any idea how to sort it with jquery, so pardon for no "trying" code.
 
Back
Top