Completed
Last Updated: 20 Nov 2014 20:39 by ADMIN
Stacey
Created on: 24 Aug 2014 18:13
Category: Kendo UI for jQuery
Type: Feature Request
2
Please add k-data-item binding directive for AngularJS
Right now, Kendo's angular support is beautiful, but I found a majorly lacking feature. 

By default, you can bind to either the ng-model or k-ng-model to get the value from a widget. But there are a number of widgets that have a dataItem() function for returning the actual object stored.

This is extremely useful, and I use it a lot in everyday coding. While I can overload the change(e) function, it would be REALLY awesome if retrieving this and binding it back to the $scope was built in. I have a demo directive written to show you how I am accomplishing this right now, but it would sure be nice to have it baked right in.

Since the uservoice portal does not allow markdown or formatting syntax, I am linking you a pastebin so you can see the code I created.

http://pastebin.com/rM288qJK

This is certainly not bulletproof, but here is how I use it;

<select kendo-drop-down-list k-options="kendoDropDownListOptions" k-data-item="Model.Group"></select>

I sure would appreciate a more native approach, though. I don't enjoy having to go around Kendo's back to do this, when it really should be baked right in. The function is provided out of the box, there's no reason not to allow for it! This would easily be done by adding a bit of code to line 375 in kendo.angular.js, as an OUT3 case outcome. I have successfully gotten to the function in question in that part of kendo by using widget.element.data().dataItem(), but that is a pretty hacky way to do it. I'm sure that the actual devs could find a much smarter way to get to it.
1 comment
Stacey
Posted on: 16 Sep 2014 20:32
Since this is being done through the improvements to k-ng-model in the next build, can I get this question removed and refunded? I really appreciate that telerik listened to me, and actively worked on this feature. I am exceedingly grateful, in fact. It will save a lot of time in my projects.