Unplanned
Last Updated: 29 Apr 2020 12:10 by ADMIN
n/a
Created on: 15 Apr 2020 19:11
Category: TreeList
Type: Feature Request
1
Expore .HtmlAttributes (similar to other components) on all elements such as commands.

.HtmlAttributes is available to columns, but not to elements such as commands.

                 columns.Add().Command(command => {
                    command.CreateChild();
                    command.Edit();
                    command.Destroy();
                    command.Custom().Name("custom").Text("Details").Click("cmdDetails");
                    command.Custom().Name("change").Text("Change Control").Click("cmdChangeControl");
                });

 

Should work the same as other elements/components and allow:

command.Edit().HtmlAttributes(new { type = "button", @class = "btn btn-primary" });   <- from grid. 

3 comments
ADMIN
Alex Hajigeorgieva
Posted on: 29 Apr 2020 12:10

Hi, Eric,

I agree with you that it would have been better to have the column definitions be identical, however I believe it will not be fulfilled to avoid breaking changes.

On the other hand, the HtmlAttributes are definitely a cool addition that we should have so thank you for suggesting it.

Kind Regards,
Alex Hajigeorgieva
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.
n/a
Posted on: 22 Apr 2020 12:39

Thank you Alex. That's a lot of overhead and there are probably other better ways but I can see that working out as well.

 .Template("#=isitcompleted(data)#") is functional and less compute for style, or override it is either the databound or document ready phases.

I really like the treelist component but it seems like it doesn't have the alignment of the other products.  Since it generates a grid, aligning more to the grid for all elements would make it much more friendly.

 .Bound instead of .Add for columns, .HtmlAttributes for easy style adjustments, etc. 

ADMIN
Alex Hajigeorgieva
Posted on: 22 Apr 2020 12:22

Hello, Eric,

Thank you very much for the suggestion, I believe it would be beneficial indeed.

Meanwhile you could add a class by using the ClassName() method:

 columns.Add().Width(300).Command(c =>
 {
     c.Edit().ClassName("my-class");
})

Then, if you would like to add other attributes, you could loop the rows on the DataBound event and target the ones with the custom class. You may also need to perform the same operation on the Cancel() event with a timeout. Let me know in case you need an example how to do that.

Kind Regards,
Alex Hajigeorgieva
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.