Unplanned
Last Updated: 23 Jan 2020 12:08 by ADMIN
Richard
Created on: 11 Feb 2014 22:49
Category: Grid
Type: Feature Request
1
Add rowAttributes properties to extend the usefulness of the automatic kendo Grid template
The current built-in _tmpl: method of kendo.grid constructs a very nice automatic row template that is aware of alternation, hasDetails and all the columns.* configuration settings such as formats and attributes.

Two new templateSettings could make the automatic template even more useful, especially for row-wise highlighting based on data conditions (aka traffic highlighting):

templateSettings.autoGridTrClassHook : string
- inject addtional classes or kendo template source into the class="..." attribute of the <TR> element in the automatic row template

templateSettings.autoGridTrHook : string
- inject addtional html source or kendo template source into the <TR> element of the automatic row template


Example

$('#grid').empty().kendoGrid({
  dataSource: myRemoteDS,
...
  templateSettings: { autoGridTrClassHook: '# if (data.Recent==="Y") { # is-recent #}#' },
...



Some css

.is-recent {
	font-style: italic;
	background: #FFFFCC;
}
.is-recent.k-alt {
	font-style: italic;
	background: #FFFF99;
}
.is-recent.k-state-selected {
	font-style: italic;
	background: #6600FF;
}
1 comment
ADMIN
Alex Hajigeorgieva
Posted on: 23 Jan 2020 12:08

Hello, Richard,

This functionality can currently be achieved by utilizing the columns.attributes but we can see that having the attributes in the row would make it an easier way to handle scenarios where different styles are required for the rows :

https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.attributes

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.