Enabled data-bind attribute in MVVM accepts only a function

5 posts, 0 answers
  1. Sunny
    Sunny avatar
    8 posts
    Member since:
    Dec 2014

    Posted 20 Mar 2015 Link to this post

    With other widgets, the data-bind="enabled: false" attribute normally works, and disables that particular widget in MVVM, but it seems like this parameter only works with a function name.

    Using Kendo 2014.3.1119. Checked the update logs, and didn't see this particular issue addressed.
  2. Sunny
    Sunny avatar
    8 posts
    Member since:
    Dec 2014

    Posted 20 Mar 2015 in reply to Sunny Link to this post

    Sunny said:With other widgets, the data-bind="enabled: false" attribute normally works, and disables that particular widget in MVVM, but it seems like this parameter only works with a function name.

    Using Kendo 2014.3.1119. Checked the update logs, and didn't see this particular issue addressed.


    Sorry, meant that it only takes a reference to a bound parameter, and not a boolean as well.
  3. Kendo UI is VS 2017 Ready
  4. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 24 Mar 2015 Link to this post

    Hello Sunny,

    If I understood correctly, the problem is that the "button widget enabled binding does not work when the bound field contains boolean value". Is that correct?

    I was not able to reproduce the behaviour in this demo page. What am I missing?

    Regards,
    Alexander Valchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  5. Sunny
    Sunny avatar
    8 posts
    Member since:
    Dec 2014

    Posted 25 Mar 2015 in reply to Alexander Valchev Link to this post

    What I'm looking for is for this to be working:

    <button data-role="button" data-bind="enabled: false">Click me</button>
  6. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 27 Mar 2015 Link to this post

    Hello Sunny,

    This is not possible, you must bind to a value in the ViewModel. In case you want to just disable the button, use a data-enable attribute:

    <button data-role="button" data-enable="false">Click me</button>


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