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

attach to error event for every datasource

6 Answers 106 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
Dan asked on 18 Jun 2018, 02:30 PM

Is there a way to attach to any datasource event error? Something like jquery.on method that attaches also to events for elements that are going to be added in the future.

So what I would like is to display to the user a popup message when an error appears, but I would not like to add to every datasource an event for errors, because I would like to avoid forgetting to add it to a datasource.

6 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 20 Jun 2018, 09:32 AM
Hello Dan,

In Kendo UI events can be attached during the widget's initialization or after its initialization. See the following documentation section, which demonstrates the available ways of attaching events.

Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 20 Jun 2018, 10:06 AM

Hi Ivan,

I already know how to attach to a specific datasource event. What I want is to know if there is a way to attach to every datasource events and how.

0
Ivan Danchev
Telerik team
answered on 22 Jun 2018, 04:45 AM
Hi Dan,

The two approaches I mentioned can be used to attach handlers to a specific DataSource instance. jQuery.on or other similar methods of attaching events to multiple DataSource instances are not applicable, because the DataSource is not initialized from an HTML element like most of the other widgets, but assigned to a variable. So if you have an array of variables that hold the DataSource instances you can loop over them and attach a handler, but this might be too much of an overhead as opposed to attaching the handler to each DataSource individually.

Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 22 Jun 2018, 09:15 AM

Hi Ivan,

I was affraid of that. The reason I want to attach to every datasource is because when something is wrong with the datasource the telerik code does not provide any feedback. So I need to attach to every datasource error event and provide a feedback to the developer that something might be wrong with the code.

Also I have read somewhere that you can overwrite some telerik functionality using the fn object. Would that be an alternative?

0
Ivan Danchev
Telerik team
answered on 25 Jun 2018, 03:11 PM
Hi Dan,

The following documentation section contains more details on how custom widgets can be created and custom behavior can be achieved by extending the Kendo UI widgets.
As for whether the particular requirement you aim at implementing can be achieved by extending the DataSource and overriding the existing functionality, this we cannot confirm or deny. The Support Service provides guidance on built-in features, while custom implementations such as the one you are after fall within the scope of professional consulting that can be provided by our Professional Services. They can perform the research required for answering the question whether the customization in question is possible, and can provide guidance or assistance with its implementation, if such is needed. In case you are interested in our colleagues' services, let me know and I will put you in contact with them.

Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 26 Jun 2018, 11:12 AM

Hi Ivan,

I do not want to use a custom widget because that would mean that I have to customize any widget that uses a datasource to use the new custom datasource widget. So this is not really a solution. I was hopping that overwriting the telerik datasource with the fn object I could skip the widget customization.

If you don't know about the fn it's OK I will search the forums for it on grid and find how it can be used.

Tags
Data Source
Asked by
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Ivan Danchev
Telerik team
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
Share this question
or