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

OData single entity responses not processed

2 Answers 47 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Terje
Top achievements
Rank 1
Terje asked on 26 Aug 2015, 01:50 PM

I'm consuming an OData source with two main routes: /odata/Transactions to get an overview and /odata/Transactions(ID) to get additional details. I put the overview data into a grid, and have a command in that grid to open a kendo window for details which should populate from the single entity route. *

I'm trying to solve this by using two datasources:

  • viewModel.Transactions loads the overview as normal for DataSource and works well so far.
  • viewModel.SelectedTransaction loads from an url computed from viewModel.selectedID. It has the same schema as Transactions except adding a few fields and using schema.data to wrap single objects in an array.
  • The grid command sets viewModel.SelectedID
  • A listener function is bound to SelectedID's "change" event to trigger viewmodel.SelectedTransaction.read(), since transport.url doesn't seem to work as a computed field that triggers directly.

When I use the command button what currently happens is

  1. SelectedID changes.
  2. SelectedTransaction is triggered to read().
  3. The URL function is called and returns the correct URL.
  4. An XHR goes out and a response comes back with appropriate OData JSON for the selected transaction.
  5. This message seems to then be dropped with no processing. Breakpoints in the datasource configuration's schema.data, schema.parse or errors are never hit. No exceptions are thrown.

I'm trying to find out why the OData response seems to go unprocessed. Any help is appreciated.

 

*: This is because the underlying data sources are maintained by different services. To get the extra details requires joining in tables in another database, and which database that is can vary between transactions. We would rather do this one at a time, when we know the user wants those details.

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 31 Aug 2015, 06:29 AM
Hello Terje,

It is quite unexpected behavior. The datasource should either call the error or the change event handler (the parse, data, total callbacks are called here). If there are not JavaScript errors, the behavior becomes even stranger.

In order to assist you further, we will need to review the issue locally. Would it be possible to send us a repro Dojo demo or runnable test project? This will allow us to debug the case and find the cause of the issue.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Terje
Top achievements
Rank 1
answered on 02 Sep 2015, 01:23 PM
Because of this issue plus another requirement coming up that would require filtering OData URLs aren't a natural fit for, we've moved over to a WebAPI backend with less conventions for us to break. This issue hasn't come back up there, so I probably won't have time to make a repro demo unfortunately.
Tags
Data Source
Asked by
Terje
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Terje
Top achievements
Rank 1
Share this question
or