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

Title attributes on Grid generated filter textbox and filter dropdowns

5 Answers 16 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ravi
Top achievements
Rank 1
Veteran
Ravi asked on 30 Sep 2020, 02:11 PM

Hi, 

 

I'm using Kendo React Grids with filter in my application which generates column filter textbox and filter options dropdown. The requirement for me (part of ADA compliance) is any filed that user may execute an action should have a associated text with it when hovered on it. A HTML title attribute on column filter textbox and filter options dropdown would resolve this issue. 

 

The Grid did not generate title attribute on filter textbox and filter options dropdown but the clear filter textbox button has title attribute.

 

How do I resolve this issue. Any help is much appreciated.

5 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 01 Oct 2020, 12:33 PM

Hi,

Currently, the title attribute of the filter cells cannot be configured through Grid props.

Here is how you can set the title attributes by accessing the DOM elements - https://stackblitz.com/edit/react-jm5ykt?file=app/main.jsx.

I hope this helps.

Regards,
Nikolay
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Gaurav
Top achievements
Rank 1
answered on 13 Oct 2020, 05:55 PM

Hello ,

 

we tried to use the example you provided but  the element attribute is always coming as undefined and is inaccessible. please see the screenshot attached in debug mode. There is no element attribute defined for the grid object so we cannot go any further on it.

can you please take a look?

0
Nikolay
Telerik team
answered on 15 Oct 2020, 11:19 AM

Hi,

It is actually not public. Here is another example - https://stackblitz.com/edit/react-jm5ykt-kunqtf?file=app/main.jsx. I accessed the grid element using a class name.

componentDidMount() {
    const gridElement = document.querySelector(".grid-class");
	...
}

render() {
    return (
		<Grid
			className="grid-class"
			...
		</Grid>
	);
}

Regards,
Nikolay
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).

0
Gaurav
Top achievements
Rank 1
answered on 15 Oct 2020, 03:24 PM

Hi Nikolay,

Thanks for your response but there is still an issue. For some reason the attributes are not getting written for the filter text boxes in the grid.  I tried couple of ways and I can see that filter textbox can be accessed but it do not generate the title attribute.

#The way you suggested - 

 const gridElement = document.querySelector(".grid-class");
    if (gridElement !== null) {
      const filterRow = gridElement.querySelector("tr.k-filter-row");
      if(filterRow !== null){
        filterRow.cells
        .item(0)        
        .querySelector(".k-textbox")
        .setAttribute("title", "Procedure Number Filter");
        filterRow.cells
        .item(0)
        .querySelector(".k-textbox")
        .setAttribute("className", "xxxxxxxxxxxx");        
      }      
    }

#Another way 

 let x = document.getElementsByClassName("grid-class").item(0).getElementsByClassName("k-filter-row").item(0).getElementsByClassName("k-textbox").item(0);
    x.setAttribute("title", "Procedure Number Filter");

please find the screenshot attached of the final html rendered.

Thanks

Gaurav Joshi

0
Nikolay
Telerik team
answered on 16 Oct 2020, 11:55 AM

Hi Gaurav,

As the attribute is applied in the standard example, please share a runnanble example where the attribute is not applied and we will check it.

Regards,
Nikolay
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).

Tags
General Discussions
Asked by
Ravi
Top achievements
Rank 1
Veteran
Answers by
Nikolay
Telerik team
Gaurav
Top achievements
Rank 1
Share this question
or