Dec 07, 2012, 4:05 PM
[CLOSED] Error with Mapping property on Store
Hi,
I can't get the mappingName property work.
In debug I see "new_Famiglia.Name" has got a value but I got this error: "Run-time Error of Microsoft JScript: 'new_Famiglia.Name' is null or is not an object" (see image with Italian error message).
The "IncidentId" field is displayed.
Where am I wrong?
I can't send a working example as my data source is Microsoft CRM OData protocol.
Please, can you help me?
Thanks in advance
Marco
.aspx
.cs
I can't get the mappingName property work.
In debug I see "new_Famiglia.Name" has got a value but I got this error: "Run-time Error of Microsoft JScript: 'new_Famiglia.Name' is null or is not an object" (see image with Italian error message).
The "IncidentId" field is displayed.
Where am I wrong?
I can't send a working example as my data source is Microsoft CRM OData protocol.
Please, can you help me?
Thanks in advance
Marco
.aspx
<ext:GridPanel ID="gpTicketMonitor"
runat="server"
Title="Ticket Monitor"
>
<Store>
<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model ID="Model1" runat="server">
<Fields>
<ext:ModelField Name="IncidentId" />
<ext:ModelField Name="new_Famiglia" Mapping="new_Famiglia.Name" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column runat="server" Text="IncidentId" DataIndex="IncidentId" />
<ext:Column runat="server" Text="new_Famiglia" DataIndex="new_Famiglia" />
</Columns>
</ColumnModel>
</ext:GridPanel>
WebService Method [WebMethod]
public DataServiceCollection<Incident> getIncident_List()
{
DataServiceCollection<Incident> IncidentCollection;
var query = from c in _context.IncidentSet
where c.IncidentId == new Guid("c63d4f0e-7340-e211-90fe-00155dde0185")
select new Incident
{
IncidentId = c.IncidentId,
new_Famiglia = c.new_Famiglia
};
IncidentCollection = new DataServiceCollection<Incident>();
IncidentCollection.Load(query);
return IncidentCollection;
}
.cs
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
DataWebService wsData = new DataWebService();
this.Store1.DataSource = wsData.getIncident_List();
this.Store1.DataBind();
}
}
Last edited by Baidaly; Dec 08, 2012 at 12:16 AM.
Reason: [CLOSED]