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

Display custom / model errors

1 Answer 1065 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ricky
Top achievements
Rank 2
Ricky asked on 14 Apr 2017, 10:48 AM

Hello,

I was wondering if there is some kind of automatic display of custom or model errors. To check this out, I created an example in the dojo.

When the returned data contains the property defined as errors within the model, the error callback is called. But I would have expect that it creates an error message within the Grid like it does with No records available (but maybe in red). Instead the grid remains empty, neither displaying the custom error nor saying No records available.

Is there a way to enable displaying custom errors within the Grid itself like the No records available message? Or will I have to push some DOM elements there by myself in the error function? If the later, is there an event which is called when no model/custom error is there anymore so I know when to remove my DOM elements showing the error?

For short reference here the last grid example from my dojo which just creates an empty grid:

01.$('#grid3').kendoGrid({
02.  columns: [{field: 'name'},{field: 'age'}],
03.  dataSource: new kendo.data.DataSource({
04.    data: { apiError: ['Server is under maintainance!'] },
05.    schema: { errors: 'apiError' },
06.    error: function(e) {
07.      console.error('grid error:', e);
08.    },
09.  }),
10.  noRecords: true,
11.});

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 18 Apr 2017, 08:43 AM
Hello Ricky,

Unfortunately, the Grid support only no data custom messages.

In this scenario, the error handling and displaying the message to the user have to be done manually.

I can suggest a couple of events which can be used to remove the DOM element if the data is available and the request is successful:

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#events-requestEnd

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-dataBinding

Also, I can suggest submitting a feature request for the desired functionality and based on its popularity we may implement it in a future release:

http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback/category/170280-grid


Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Ricky
Top achievements
Rank 2
Answers by
Stefan
Telerik team
Share this question
or