CSS Data Binding

2 posts, 0 answers
  1. Jeremy
    Jeremy avatar
    1 posts
    Member since:
    Sep 2014

    Posted 22 Jul 2015 Link to this post

    Does the css data binding work with kendo buttons? 

    <button type="button"
    aria-label="Thumbs up"
    data-role="button"
    data-bind="events: { click: thumbsUp }, css:{k-state-active: isThumbsUp}">
    <i class="icon-thumbs-up icon-large"></i>
    </button>

  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 24 Jul 2015 Link to this post

    Hi Jeremy,

    This behavior is expected, because the CSS bindings work for regular HTML elements only. In this case however, the button has a data-role="button" attribute, which means it is treated as a widget. As a workaround you can remove the data-role attribute and manually add the "k-button" class to get the same appearance (see example here).

    Regards,
    Alexander Popov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
Back to Top