7 Answers, 1 is accepted
Hello,
Thank you for getting in touch with us.
Yes indeed - you are right. In the current version of the Kendo Native Grid there is no class property for the row and we should use template as for example it is done here in the general case- https://stackblitz.com/edit/s5rkb6-iwsg5p?file=index.js.
If your scenario is somehow more complicated please let me know so I could be more helpful.
Regards,
Plamen
Progress Telerik
Thank you. I knew about the row rendering but I was missing the part about passing the defautSlots. This will work fine :)
return h(
'tr',
{
class: [defaultClass,'custom']
},
defaultSlots);
This seems to work:
renderRow(h, trElement, defaultSlots, props, listeners) {
var cls = props.isAltRow ? "k-master-row k-alt" : "k-master-row";
if (props.selectedField && props.dataItem[props.selectedField]) {
cls += " k-state-selected";
}
if (props.dataItem.__viewed__) {
cls += " viewed";
}
return h("tr", {
class: cls,
on: {
click: function(e) {
if (listeners.rowclick) {
listeners.rowclick({ dataItem: props.dataItem });
}
}
}
},
defaultSlots);
}
Hello,
Thank you for getting back to us.
If you want to handle all the cases you will have to add a bit more logic in the template. Here is example that has all the default checks in it and worked correctly at my side with grouping - https://stackblitz.com/edit/8ah33e-glxq3t?file=index.js.
Please review it and let me know if you have further questions.
Regards,
Plamen
Progress Telerik