Cannot apply class or style with columns.attributes object

3 posts, 1 answers
  1. telefunken
    telefunken avatar
    2 posts
    Member since:
    May 2012

    Posted 24 Jan 2013 Link to this post

    columns: [
        { field: "id", attributes: {"class": "someclass", style: "color:#0c0"} }
    ]
    This part of the API reference explains the above definition:
    http://docs.kendoui.com/api/web/grid#columnsattributes-object

    someclass and/or the color css is never applied to the grid, any idea why?

  2. Answer
    Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    1198 posts
    Member since:
    Jan 2013

    Posted 25 Jan 2013 Link to this post

    Hello,

    I tried this code snippet and found a glitch with the code - the hash symbol from the color value should be escaped. Thanks for pointing this to us. We will update the documentation as soon as possible.

    Here is a working JS Bin example. If this doesn't fit your case, please send us a sample of your code to assist your further.

    Regards,
    Dimiter Madjarov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!

  3. telefunken
    telefunken avatar
    2 posts
    Member since:
    May 2012

    Posted 25 Jan 2013 Link to this post

    thanks!

    style: "color:\\#0c0"
    escaping the hash seems to work

Back to Top