I have a ko viewmodel, which I bind to a KendoGrid, using knockout-kendo.js
I use rowTemplate, because I need some custom functionality in some columns (icon, links, etc)
I need to do some custom functionality based on rownumber.
When binding ko viewmodel directly, I can use foreach binding and in the row template I have the $index which gives me the current row number.
How can I get the same thing when the viewmodel is bound to a Kendo Grid?
Thank you
index()
method... jsfiddle.net/F88Bf – nemesv$element
refers to the current element where you have the data-bind attribute: knockoutjs.com/documentation/binding-context.html so yourtr
you probably only needdata-bind="css: $root.altRowClass(j$($element).index())
– nemesv