How can i bind the text of a button - or anchor - to a viewmodel?

2 posts, 0 answers
  1. Peter
    Peter avatar
    4 posts
    Member since:
    Aug 2013

    Posted 28 Aug 2013 Link to this post

    To dynamically change the language of my application i' trying to use databinding to a viewmodel. It works great on labels and simple texts, but when i bind a button with e.g.

    <a data-role="button" data-bind="text: i18n.connect" data-click="app.connectClicked">TEST</a>

    I get an error message:
    The text binding is not supported by the Button widget

    Is there a workaround for this?


  2. Kiril Nikolov
    Kiril Nikolov avatar
    2543 posts

    Posted 29 Aug 2013 Link to this post

    Hello Peter,

    Such binding is not supported out of the box with Kendo UI. However using a custom binder you can achieve such functionality. Please check this example of a possible implementation:

    If you want to read more about custom binding, please follow this link:

    Kiril Nikolov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top