This is a migrated thread and some comments may be shown as answers.

Enabled data-bind attribute in MVVM accepts only a function

4 Answers 272 Views
Button
This is a migrated thread and some comments may be shown as answers.
Sunny
Top achievements
Rank 1
Sunny asked on 20 Mar 2015, 07:00 PM
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.

4 Answers, 1 is accepted

Sort by
0
Sunny
Top achievements
Rank 1
answered on 20 Mar 2015, 07:01 PM
[quote]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.[/quote]

Sorry, meant that it only takes a reference to a bound parameter, and not a boolean as well.
0
Alexander Valchev
Telerik team
answered on 24 Mar 2015, 12:04 PM
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!
 
0
Sunny
Top achievements
Rank 1
answered on 25 Mar 2015, 12:42 PM
What I'm looking for is for this to be working:

<button data-role="button" data-bind="enabled: false">Click me</button>
0
Alexander Valchev
Telerik team
answered on 27 Mar 2015, 09:07 AM
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!
 
Tags
Button
Asked by
Sunny
Top achievements
Rank 1
Answers by
Sunny
Top achievements
Rank 1
Alexander Valchev
Telerik team
Share this question
or