Though KendoUI already has an MVVM style binding, it would be much better to have a css binding allowing us to set class on HTML elements based on arbitrary conditions.
Just look at the Knockoutjs css binding.
10 comments
ADMIN
Telerik Admin
Posted on:24 Jun 2015 15:45
Included in Q2 2015
ADMIN
Telerik Admin
Posted on:09 Apr 2015 14:52
I apologize for the delay, and sorry hear that you chose another vendor because of this missing MVVM feature, Luc. Just wanted to notify all users interested in it that it's planned for our next major release, due in the end of June.
Luc
Posted on:09 Apr 2015 13:22
Kenshin, about your last reply, you say this "got delayed due to other items with higher priorities".
I guess the KendoUI programmers were kept busy with the addition of so many new features to the framework over the past 3 years, that they were unable to finish the ones already in the framework.
Why is it almost always like this with framework vendors ? They seem to be so eager to release new features, all the while ignoring the fact that the features already in the framework need tender loving care to make them usable.
Anyway, like I mentioned in my previous comment, I've ditched KendoUI a long time ago, and I will definitely encourage others to do the same. We don't need new features, we need working features.
ADMIN
Telerik Admin
Posted on:24 Nov 2014 15:27
Sorry to hear that, Luc. This feature is tentatively slated for Kendo UI 2015 release, and got delayed due to other items with higher priority.
Luc
Posted on:22 Nov 2014 04:53
2.5 years later, and only "under review"
Such a small fix... way to go Telerik !
I've bailed out long ago.
Zachary
Posted on:01 Jan 2014 03:12
There is a potential workaround on StackOverflow. Still not as clean as official support though.
http://stackoverflow.com/questions/15090913/kendo-mvvm-how-to-define-a-custom-css-binding
Stacey
Posted on:17 Aug 2013 18:04
Hey, Jeff Taylor, I am trying to get your proposed code to work but it isn't working. Is there any way I can get in touch with you to discuss this? I really like this idea.
Stacey
Posted on:17 Aug 2013 18:03
This might be better seen if put in the actual MVVM section.
Jeff
Posted on:27 Sep 2012 05:22
I like Jeff Taylor's suggested approach. it would be nice to see this officially added to the next release. CSS binding really is cleaner than style binding.
Jeff
Posted on:10 Sep 2012 17:44
Code to do this is as follows, this definitely needs to get into the next release since it a couple
line addition:
//When configuring all the bindings in kendo.web.js
binders.css = Binder.extend({
refresh: function (key) {
$(this.element).toggleClass(key, this.bindings.css[key].get());
}
});
//Within the bind element method in kendo.web.js
if (bind.css) {
bindings.css = createBindings(bind.css, source, Binding);
}
//Then you can use it as follows:
<div data-bind="css: { active: itemSelected }"/>
//This will set the active class on if the itemSelected property of your viewModel is TRUE and will remove the class if it's false. It's not a full implementation of the knockoutjs one but its a good start