This is a migrated thread and some comments may be shown as answers.

Column data attributes

1 Answer 1589 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Levon
Top achievements
Rank 1
Iron
Iron
Levon asked on 05 Feb 2019, 09:12 PM
Is there any way to add some data-attribute to "td" tag. something like this 

<kendo-grid-column [width]="100" title="ID" field="prouct_id" [attr.base]="'dataItem.prouct_id'">

</kendo-grid-column>

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 07 Feb 2019, 09:34 AM
Hello Levon,

There is no direct way of accessing and modifying the Grid generated HTML (more specifically the table TD DOM elements), barring some direct DOM manipulation via JavaScript that is not recommended in general. A possible approach is to use Cell templates and provide custom content that might include a wrapper element with the desired attributes:

https://www.telerik.com/kendo-angular-ui/components/grid/columns/templates/#toc-cell-template

If the data attributes are required for displaying some Grid cell content in a tooltip, this can be achieved as demonstrated in the following documentation article:

https://www.telerik.com/kendo-angular-ui-develop/components/tooltip/how-to/show-grid-cells-content/

I hope this helps.

Regards,
Dimiter Topalov
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.
Tags
Grid
Asked by
Levon
Top achievements
Rank 1
Iron
Iron
Answers by
Dimiter Topalov
Telerik team
Share this question
or