I'm trying to figure out how to configure an odata v3 dataSource for a field that belongs to an optional entity, particularity when using the dataSource to bind to a grid
For example, I have TableA which has an optional foreign key (FK) to TableB. My dataSource: transport: read has a url property set to odata/TableA and mydata object has $expand: "TableB". All this works great as long as every row in TableA has a valid TableB_Id. However, TableB_id is nullable, and when a row exists that has null for TableB_id, my application breaks. The error appears because in my model, I have defined a filed as follows: Name: { type: "string", nullable: true, from: "TableB.Name" },
The "from" specifies the expand entity but when the row happens to have a nullable TableB_id, TableB is undefined for that row, causing the app to crash. Placing nullable:true in the field definition probably only addresses the last segment of whats in the from statement.
Is there an easy way to address this? In my real world app, I have 5 optional tables, each with fields I'd like to bring to the grid with default type values acceptable if the entity doesn't exist.
Kendo UI v2016.1.112