Unplanned
Last Updated: 27 Apr 2021 10:05 by ADMIN
Jon
Created on: 01 Mar 2021 19:02
Category: KendoReact
Type: Feature Request
0
Click event on MenuItem component
We would like to respond to MenuItem clicks with a callback function, rather than the current navigation-based response. Probably when an onClick function is provided, the MenuItem would render a button element rather than an anchor element.
3 comments
ADMIN
Stefan
Posted on: 02 Mar 2021 10:26

Hello, Jon,

We have a task to provide a full item render for the item, which will allow the developer to customize the li element as required (rendering a button):

https://github.com/telerik/kendo-react/issues/828

I assume that that feature will allow achieving the requirement.

Regards,
Stefan
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/.

Jon
Posted on: 02 Mar 2021 10:08

Hi Stefan, thanks for the reply.

We're building a complex system composed of many separate React apps which appear to be one big app (using the single-spa framework). The "parent" UI has system-wide menus, and the individual React apps can customize the system-wide menus.

Right now we set the MenuItem data prop to a function. It works, but it feels like a hack.

Best,

j.

ADMIN
Stefan
Posted on: 02 Mar 2021 07:33

Hello, Jon,

The onSelect event will be fired when a MenuItem is clicked:

https://www.telerik.com/kendo-react-ui/components/layout/api/MenuProps/#toc-onselect

That event is attached to the onClick event of the li element.

Please let me know if there are any issues using this approach?

Regards,
Stefan
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/.