Reputation: 151
The below example adds an index number, but if you click in the various sorting columns (Contact Name, Company, Name, Country) the # doesn't update and it's not sortable. Is there a way to add the index number and have it sortable as well?
http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/Templates/add-row-numbers
Upvotes: 0
Views: 939
Reputation: 1780
Actually the index there only an increment of the data, however if you create a custom field and assign index on parse at the data source you could do it. Something like this in that example (i add field index at parse time) :
schema: {
parse: function(response) {
for (var i = 0; i < response.d.results.length; i++) {
response.d.results[i].index = i + 1;
}
return response;
}
}
then just display the index like other field, here is an example in dojo.
Upvotes: 0