Declined
Last Updated: 10 Feb 2020 08:33 by ADMIN
Christian
Created on: 03 Feb 2020 12:20
Category: FileManager
Type: Bug Report
0
Toolbar items Id function set nothing

Hi,

 

the filemanager toolbar item configurator doesnt work correct.

The Id setter function does not work.

 

CSHTML

            .Toolbar(tb => tb.Items(items =>
            {
                items.Add("notify").Text("Notify").Command("NotifyCommand").Icon("email").Type("button").Id("btnNotify");

 

Generated HTML

The Button Id get an default value.

 

Regards

Christian

1 comment
ADMIN
Dimitar
Posted on: 10 Feb 2020 08:33

Hi Christian,

The ids of the tools in the FileManager Toolbar are defined with a guid. This is required in scenarios where, for example, there is another FileManager widget on the page. In such scenario, there will be multiple elements on the page with the same id, which is not recommended and might lead to undesired side effects.

I assume that you would like to get a reference to the 'Notify' button element and apply some dynamic behavior. In order to do that, I would suggest adding a unique class to the button and use it for getting the tool reference:

items.Add("notify")
  .HtmlAttributes(new { @class = "k-filemanager-notify-btn" })
  .Text("notify")
  .Command("NotifyCommand")
  .Icon("email")
  .Type("button")
  .Id("notify");

Taking the above into consideration, I will mark the item as "Declined" as changing this behavior might result in issues with the initialization of multiple widgets.

Regards,
Dimitar
Progress Telerik

Get quickly onboarded and successful with your Telerik UI for ASP.NET MVC with the dedicated Virtual Classroom technical training, available to all active customers.