Declined
Last Updated: 11 Mar 2021 14:47 by ADMIN
vladan strigo
Created on: 26 Jan 2015 11:08
Category: Kendo UI for jQuery
Type: Feature Request
1
Introduce global event handlers
We use your grids, combo boxes and such in highly customized way, and most of them use custom functionality to complete a feature we need.

In many cases these are some default features we would like to apply to all controls of a certain type.

For example, we use a script which forces the user when using a combo box to always select a value and not enter incomplete text. This through script works like a charm, but a big problem is that each and every combo in our application must have this applied.

Another example is responsive grids....we have a script in place which on a certain resolution transforms your grid into a responsive table. This also works like a charm. The problem is that we only now made the script...we now need to apply it manually to 120+ grids in our application.

It would also be great if you would make the global event handler chainable with the regular one (so for example first the global one first from queue, then the regular one).

Aslo it would be great if it would receive the affected grid in the arguments so that we can also make selector logic...for example all grids which have some css class...execute desired functionality.

This would help SO much!
4 comments
ADMIN
Tsvetomir
Posted on: 11 Mar 2021 14:47

Hello,

The global handlers for the widgets cannot be implemented similarly to the jQuery events over the elements. The events of the widgets are triggered by the business logic. 

Therefore, you could create a custom widget extension and within the respective event call a custom function of yours.

https://docs.telerik.com/kendo-ui/intro/widget-basics/create-custom-kendo-widget

 

Regards,
Tsvetomir
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

ADMIN
Telerik Admin
Posted on: 27 Jan 2015 09:07
If you want to assign specific logic to an event which has already been bound to the grid, you need to detach it first (using the kendo.unbind method: http://docs.telerik.com/kendo-ui/api/javascript/kendo) to avoid unexpected results.

Alternatively, you can set the necessary hook in the document.ready handler of the page, as shown in the forum thread I linked, when the widgets are already available and about to be initialized.
vladan strigo
Posted on: 26 Jan 2015 14:27
Good idea! Thanks!

Does your binding logic then work as queue or it replaces the assigned handler? So for example could I add some default logic like you suggest and then when I add it also on control that it does the additional things we need per-control?


Vladan
ADMIN
Telerik Admin
Posted on: 26 Jan 2015 13:33
Thanks for this suggestion, Vladan.

Note that you can iteratively traverse all widgets of a certain type on the page (using jQuery css class selector) to apply your script logic for each instance found. More info on this approach is available in this forum discussion:
http://www.telerik.com/forums/how-to-add-global-error-handler