Hi There,
i have a oData WCF v2 pointing to an Openaccess entities set. the issue i'm having is that i'm unable to link (expand) it's relational classes within the datasource call, I get "null" and Undefined" returned when trying to call the field of the relational classes
SVC:
[System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]
[JSONPSupportBehavior]
public partial class SQZEntitiesService : OpenAccessDataService<Sequentia.SQZEntities>
{
/// <summary>
/// Initializes the service.
/// </summary>
/// <param name="config">The configuration object.</param>
public static void InitializeService(DataServiceConfiguration config)
{
config.SetEntitySetAccessRule("URLs", EntitySetRights.All);
config.SetEntitySetAccessRule("TACs", EntitySetRights.All);
config.SetEntitySetAccessRule("Offers", EntitySetRights.All);
config.SetEntitySetAccessRule("IncomingActivityInfos", EntitySetRights.All);
config.SetEntitySetAccessRule("FormReportData", EntitySetRights.All);
config.SetEntitySetAccessRule("FormData", EntitySetRights.All);
config.SetEntitySetAccessRule("DefaultChannelTypes", EntitySetRights.All);
config.SetEntitySetAccessRule("DecisionStages", EntitySetRights.All);
config.SetEntitySetAccessRule("ChannelTypes", EntitySetRights.All);
config.SetEntitySetAccessRule("ChannelInfos", EntitySetRights.All);
config.SetEntitySetAccessRule("CaptureObjectValues", EntitySetRights.All);
config.SetEntitySetAccessRule("CaptureObjectProperties", EntitySetRights.All);
config.SetEntitySetAccessRule("CaptureObjects", EntitySetRights.All);
config.SetEntitySetAccessRule("Activities", EntitySetRights.All);
// TODO: Set service behavior configuration options
// Examples:
// config.DataServiceBehavior.AcceptCountRequests = true;
// config.DataServiceBehavior.AcceptProjectionRequests = true;
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
}
}
Grid DS:
<script>
$(document).ready(function () {
$("#grid").kendoGrid({
dataSource: {
type: "odata",
transport: {
read: {
url: "/DesktopModules/SQZWCF/SQZEntitiesService.svc/Activities",
data: {
expand: "TAC,Offer"
}
}
},
schema: {
model: {
fields: {
ActivityID: { type: "number" },
TACID: { type: "number" },
Date: { type: "date" },
ChannelTypeID: { type: "number" },
Offername: { type: "text" }
}
}
},
pageSize: 10,
serverPaging: true,
serverFiltering: true,
serverSorting: true
},
height: 250,
filterable: true,
sortable: true,
pageable: true,
columns: [{
field: "ActivityID",
filterable: false
},
"TACID",
{
field: "Date",
title: "Date",
width: 200,
format: "{0:MM/dd/yyyy}"
},
"ChannelTypeID",
"Offername"
]
});
});
</script>
i have a oData WCF v2 pointing to an Openaccess entities set. the issue i'm having is that i'm unable to link (expand) it's relational classes within the datasource call, I get "null" and Undefined" returned when trying to call the field of the relational classes
SVC:
[System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]
[JSONPSupportBehavior]
public partial class SQZEntitiesService : OpenAccessDataService<Sequentia.SQZEntities>
{
/// <summary>
/// Initializes the service.
/// </summary>
/// <param name="config">The configuration object.</param>
public static void InitializeService(DataServiceConfiguration config)
{
config.SetEntitySetAccessRule("URLs", EntitySetRights.All);
config.SetEntitySetAccessRule("TACs", EntitySetRights.All);
config.SetEntitySetAccessRule("Offers", EntitySetRights.All);
config.SetEntitySetAccessRule("IncomingActivityInfos", EntitySetRights.All);
config.SetEntitySetAccessRule("FormReportData", EntitySetRights.All);
config.SetEntitySetAccessRule("FormData", EntitySetRights.All);
config.SetEntitySetAccessRule("DefaultChannelTypes", EntitySetRights.All);
config.SetEntitySetAccessRule("DecisionStages", EntitySetRights.All);
config.SetEntitySetAccessRule("ChannelTypes", EntitySetRights.All);
config.SetEntitySetAccessRule("ChannelInfos", EntitySetRights.All);
config.SetEntitySetAccessRule("CaptureObjectValues", EntitySetRights.All);
config.SetEntitySetAccessRule("CaptureObjectProperties", EntitySetRights.All);
config.SetEntitySetAccessRule("CaptureObjects", EntitySetRights.All);
config.SetEntitySetAccessRule("Activities", EntitySetRights.All);
// TODO: Set service behavior configuration options
// Examples:
// config.DataServiceBehavior.AcceptCountRequests = true;
// config.DataServiceBehavior.AcceptProjectionRequests = true;
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
}
}
Grid DS:
<script>
$(document).ready(function () {
$("#grid").kendoGrid({
dataSource: {
type: "odata",
transport: {
read: {
url: "/DesktopModules/SQZWCF/SQZEntitiesService.svc/Activities",
data: {
expand: "TAC,Offer"
}
}
},
schema: {
model: {
fields: {
ActivityID: { type: "number" },
TACID: { type: "number" },
Date: { type: "date" },
ChannelTypeID: { type: "number" },
Offername: { type: "text" }
}
}
},
pageSize: 10,
serverPaging: true,
serverFiltering: true,
serverSorting: true
},
height: 250,
filterable: true,
sortable: true,
pageable: true,
columns: [{
field: "ActivityID",
filterable: false
},
"TACID",
{
field: "Date",
title: "Date",
width: 200,
format: "{0:MM/dd/yyyy}"
},
"ChannelTypeID",
"Offername"
]
});
});
</script>