Dec 20, 2010, 1:00 PM
[CLOSED] DataView Template unable to read the store Record Field
hi ,
My environment:
windows 7 64 bit.
EXT.NET RC.
Visual studio 2010.
im try to show a window contained a dataview , the dataview gets its data from a store in the page, i face a set of problem:
1. when i bind my store to a list<mydynamicobject> , the store is not filled and it is returned empty.
2.when i bind my store to a list<object> it is working fine , but now i face problem where th store Record field are returned empty inside the template
The code behind:s
i need really know two things:
1. why when im using list of mycustomobject the store is empty and i wana tell that my mycustomobject is seiazable and have have empty constructor, and when im using list<object> the store have data.
2.by now my store have data but my dataviews does not get these data (does not recognized my Store Record Fields).
My environment:
windows 7 64 bit.
EXT.NET RC.
Visual studio 2010.
im try to show a window contained a dataview , the dataview gets its data from a store in the page, i face a set of problem:
1. when i bind my store to a list<mydynamicobject> , the store is not filled and it is returned empty.
2.when i bind my store to a list<object> it is working fine , but now i face problem where th store Record field are returned empty inside the template
The code behind:s
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SocialDealer.Data;
using SocialNetworksUtility;
using Ext.Net;
using Ext.Net.Utilities;
namespace DashboardTesting
{
public partial class DataViewwithwindow : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
List<object> results = new List<object>();
results.Add(new { range = "5-9", rangevalue = "10" });
results.Add(new { range = "20-30", rangevalue = "20" });
// foreach (DataRow row in oset.Tables[0].Rows)
// {
// results.Add(new FacebookRangeStatiscs() { range = row["range"].ToString(), value = row["value"].ToString() });
//}
//viewBy.DataSource = oset.Tables[0];
//viewBy.DataBind();
ByStore.DataSource = results;
ByStore.DataBind();
ByWindow.Show();
}
}
}
}
and here is my aspx page HTML: <ext:ResourceManager ID="ResourceManager1" Theme="Gray" runat="server" DirectMethodNamespace="SocialDelear" />
<ext:Store ID="ByStore" runat="server" AutoLoad="false" RemoteSort="false" ShowWarningOnFailure="true">
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="range"/>
<ext:RecordField Name="rangevalue"/>
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
<ext:Window
ID="ByWindow"
runat="server"
Resizable="false"
Height="200px"
Hidden="true"
Modal="true"
Width="100" >
<LoadMask ShowMask="true" />
<Items>
<ext:BorderLayout runat="server" ID="BorderLayout">
<Center>
<ext:Panel runat="server" AutoScroll="true">
<Items>
<ext:DataView ID="DataView3" runat="server" StoreID="ByStore" AutoHeight="true" MultiSelect="true"
OverClass="x-view-over" ItemSelector="div.thumb-wrap" EmptyText="No images to display">
<Template ID="Template5" runat="server">
<Html>
<tpl for=".">
<table>
<tr>
<td>
muath bgool bas
</td>
<td>
{range}
</td>
</tr>
</table>
</tpl>
<div class="x-clear"></div>
</Html>
</Template>
</ext:DataView>
</Items>
</ext:Panel>
</Center>
</ext:BorderLayout>
</Items>
</ext:Window>
<ext:Panel ID="Panel1" runat="server" Frame="true" Width="535" AutoHeight="true" Collapsible="true" title="the view">
<Items>
<ext:DataView ID="ImageView" runat="server" StoreID="ByStore" AutoHeight="true"
OverClass="x-view-over" ItemSelector="div.thumb-wrap" EmptyText="No images to display">
<Template runat="server">
<Html>
<table>
<tpl for=".">
<tr>
<td>
{range}
</td>
</tr>
</tpl>
</table>
</Html>
</Template>
</ext:DataView>
</Items>
<Content>
there is a content
</Content>
</ext:Panel>
the imageview Dataview and DataView3 are not shown anything.i need really know two things:
1. why when im using list of mycustomobject the store is empty and i wana tell that my mycustomobject is seiazable and have have empty constructor, and when im using list<object> the store have data.
2.by now my store have data but my dataviews does not get these data (does not recognized my Store Record Fields).
Last edited by Daniil; Dec 20, 2010 at 4:13 PM.
Reason: [CLOSED]