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

HtmlAttributes does nothing

5 Answers 524 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 14 Aug 2012, 08:25 PM
Tried the HtmlAttributes method on the mvc extensions for listview

@(Html.Kendo().ListView<ViewModel>()
.Name("listView")
.HtmlAttributes(new { @class = "some-class" }))

This does not set the class. Also tried "style" and nothing. Might be a bug.

5 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 15 Aug 2012, 06:18 AM
Hello Adam,

Setting attributes through HtmlAttributes is currently unsupported. However if you can add the class on $(document).ready( /* handler */ ).

Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Matt
Top achievements
Rank 1
answered on 28 Aug 2012, 04:59 AM
Thanks - Are there any plans to support adding HtmlAttributes through the mvc helpers?
0
Atanas Korchev
Telerik team
answered on 31 Aug 2012, 07:13 AM
Hi,

 We plan to add support for HtmlAttributes in the next official release.

Greetings,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
John
Top achievements
Rank 1
answered on 22 Nov 2012, 11:33 AM
Are HtmlAttributes now supported in the November 2012 release? Need to use them in the TreeView control.


Thanks!
0
Alex Gyoshev
Telerik team
answered on 22 Nov 2012, 02:48 PM
Hello John,

If you need to set the HtmlAttributes of the root element of the tree, it is supported in  the latest internal builds. If you need per-node attributes, you need to use client-side templates and serialize the classes from the server. If you need help with implementing this in your specific scenario, please open a support ticket and send a sample solution that replicates the case.

Greetings,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ListView
Asked by
Adam
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Matt
Top achievements
Rank 1
Atanas Korchev
Telerik team
John
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Share this question
or