Unplanned
Last Updated: 29 Sep 2020 18:28 by ADMIN
Philip
Created on: 23 Apr 2020 15:38
Category: Button
Type: Feature Request
3
Id attribute on buttons (TelerikButtons, GridCommandButtons, etc..)

It would help me with my testing mostly.

===

ADMIN EDIT

You may also want to vote for and follow this request for adding Id property to all components

https://feedback.telerik.com/blazor/1495842-add-id-parameter-on-all-blazor-components

===

 

3 comments
ADMIN
Marin Bratanov
Posted on: 29 Sep 2020 18:28

Hi Philip,

The ID was added to the Button due to internal refactoring, but the grid command buttons do not implement it yet, even though they inherit the property and you see it in the intellisense.

At this point, adding a custom Class is the best option I can offer for identifying command buttons in the grid for your tests. Once an ID parameter gets implemented it should be relatively easy to switch to that if you extract that comparison logic for buttons in a method.

Regards,
Marin Bratanov
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Philip
Posted on: 29 Sep 2020 17:14
It seems as if this feature has been implemented at some point. I'm looking at an environment on 2.17.0 and I have an Id property available on TelerikButtons and GridCommandButtons. Not sure when it was introduced, but seems like all it is missing is maybe some documentation as the only reference to it is in the API reference.
ADMIN
Marin Bratanov
Posted on: 23 Apr 2020 15:40

To add a small clarification - if this does get exposed for command buttons, it is likely that the developer would be responsible for ensuring it is unique, as each button would get repeated for each row. This also applies for reusing components and when you have more than one instance of the same component on the same page - you will need to have unique IDs on all rendered elements across the entire HTML page.

 

Regards,
Marin Bratanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.