HtmlAttributes does nothing

6 posts, 0 answers
  1. Adam
    Adam avatar
    24 posts
    Member since:
    Nov 2011

    Posted 14 Aug 2012 Link to this post

    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.

  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    1919 posts
    Member since:
    Sep 2012

    Posted 15 Aug 2012 Link to this post

    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!

  3. Matt
    Matt avatar
    8 posts
    Member since:
    Jun 2010

    Posted 27 Aug 2012 Link to this post

    Thanks - Are there any plans to support adding HtmlAttributes through the mvc helpers?

  4. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8277 posts
    Member since:
    Sep 2012

    Posted 31 Aug 2012 Link to this post

    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!

  5. John
    John avatar
    2 posts
    Member since:
    Aug 2012

    Posted 22 Nov 2012 Link to this post

    Are HtmlAttributes now supported in the November 2012 release? Need to use them in the TreeView control.


    Thanks!

  6. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2078 posts
    Member since:
    Sep 2012

    Posted 22 Nov 2012 Link to this post

    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!

Back to Top