Completed
Last Updated: 02 Oct 2012 14:41 by David
David
Created on: 22 Mar 2012 16:09
Category: Kendo UI for jQuery
Type: Feature Request
14
Follow proper Plugin Authoring guidelines
Hello,

I very much appreciate the effort put into kendoUI, and the widgets look pretty good.  I just have one major issue with how the methods can be called upon as they have an enourmous impact on our code since object chaining and the great advantages jQuery offers with object chaining is simply being thrown away because of the way you force us to use the .data() method to get the kendoUI object.

Following the guidelines on http://docs.jquery.com/Plugins/Authoring, we should be able to do the following:

$('div.grid').kendoGrid(); // Initilises the grid
$('div.grid').kendoGrid('refresh'); // calls the refresh method on the grid

this should always return the jquery object which enables object chaining, so we might do the following:

$('div.grid').kendoGrid('refresh').show();

Unfortunately, the above example using KendoUI would need to be translated into:

$('div.grid').data("kendoGrid").refresh();

because the .data() method obviously does not return a jQuery object, and the refresh() method doesn't either, we can no longer benefit from chaining, and need to reselect the object to execute the show() method:

$('div.grid').show();

This obviously does make things more complicated, and will cause for more code.

I sincerely believe this needs to be addressed.  A forum topic on this is available at http://www.kendoui.com/forums/ui/general-discussions/why-aren-t-widget-methods-just-added-through-object-extention.aspx#2040399
2 comments
David
Posted on: 02 Oct 2012 14:41
I'm sorry, but I'm still not convinced Telerik understood the greatness of jQuery, and its extenability.

For instance.

A normal textarea supports the .change event so that each time something is entered into the texterea, we can do something.

$('textarea').change(function() { alert($(this).val()); }

this is great.
Well - when that text area is being converted into a kendo ui editor, this event is no longer available.  The beauty of jQuery is that you need to EXTEND existing functionality by adding your own, not by just throwing the basic functionality away, and writing events from the ground up.

Yes, you now have a change event added to the editor, but:
 - it's not behaving as an actual CHANGE event, but more like an "onblur" event with an additional constraing (the value had to be changed in order to be triggered...)
 - I can not call it by doing the above, but in stead I'm still required to get the data object you created, and to even needing to call the .bind() methoid in stead of supporting the shortcut methods for events...

I have been discussing this with John Bristowe for a while now, and I'm still very much in favour of a commercially supported jQuery ui framework, but yuo guys really need to focus on straightening this out, as this is not what I expect from a jquery based framework...

In case you're wondering why we need the normal behaviour of the change event: the editor is used in a support ticket submission form; whil the customer types his question, we're doing an ajax call to the server with the contents so we can retrieve FAQ-entries and present them to the customer prior to them submitting this.  This worked really well (we built in a delay), but now we're being forced into searching an alternative use case, as your editor won't allow me to do this at all...

Really - I think you have some potential here, but as it is now, we can not use this in production (even though much of the code we have already started to migrate to using some of your widgets due to the delays the jQuery UI framework has...)

I sincerely hope we can see some improvement here!
ADMIN
Brandon
Posted on: 15 May 2012 16:36
Delivered in the Q1 service pack.