Sep 16, 2012, 2:39 PM
Dataview doesn't work properly for dashboard(grouping)
Problem with IsComplex="true"
Hi, I have an aspx page that worked fine in version 1.x. When I moved the application to v2, I had an issue with
the dataview that I tracked down to the (ext:ModelField Name="Items" IsComplex="true") as shown below. I know
that I am not supposed to used it with a JasonReader but the code perfectly in v1.x.
The oridinal code looked like this in V1.x:
If you use it, it will give you the internalid error. I have checked the data that is returned and it looks correct with respect the what the
Url method. The <Tpl> tag gives the internalid error when it tries to display the data. Your example for the grouping sample does not use a
IsComplex attribute. This is the reason it works. If I comment the IsComplex field, the dataview works properly. The problem is with children of the items field. It cannot deal with nested children or Complex based field types. I tried the XmlReader but that didn't work either. I think that the problem can be reproduced if the AjaxProxy tag is used in your grouping sample as I show above.
Hi, I have an aspx page that worked fine in version 1.x. When I moved the application to v2, I had an issue with
the dataview that I tracked down to the (ext:ModelField Name="Items" IsComplex="true") as shown below. I know
that I am not supposed to used it with a JasonReader but the code perfectly in v1.x.
The oridinal code looked like this in V1.x:
<ext:Store runat="server" ID="Store1" AutoLoad="true">
<Proxy>
<ext:HttpProxy Url="/Data/GetHomeSchema/" />
</Proxy>
<Reader>
<ext:JsonReader Root="data">
<Fields>
<ext:RecordField Name="Title" />
<ext:RecordField Name="Items" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
<ext:Panel ID="DashBoardPanel" runat="server" Cls="items-view" AutoHeight="true" Border="false">
<Items>
<ext:DataView ID="DataView1"
runat="server"
StoreID="Store1"
SingleSelect="true"
OverClass="x-view-over"
ItemSelector="div.item-wrap"
AutoHeight="true"
EmptyText="No items to display"
Layout="Fit">
<Template ID="Template1" runat="server">
<Html>
<div id="items-ct">
<tpl for=".">
<div>
<h2><div>{Title}</div></h2>
<dl>
<tpl for="Items">
<div class="item-wrap" ext:panel="{Accordion}" ext:menu="{MenuItem}">
<img src="{itemIcon}"/>
<div>
<H6>{Title}</H6>
</div>
</div>
</tpl>
<div style="clear:left">
</div>
</dl>
</div>
</tpl>
</div>
</Html>
</Template>
<Listeners>
<SelectionChange Fn="selectionChanged" />
<ContainerClick Fn="viewClick" />
</Listeners>
</ext:DataView>
</Items>
</ext:Panel>
The current code is as follows in v2.x: <ext:Store runat="server" ID="DashBoardStore" AutoLoad="true">
<Proxy>
<ext:AjaxProxy Url="/Data/GetHomeSchema/" >
<Reader>
<ext:JasonReader Record="Title" />
</Reader>
</ext:AjaxProxy>
</Proxy>
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="Title" />
<ext:ModelField Name="Items" IsComplex="true" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
<ext:Panel ID="DashBoardPanel" runat="server" Cls="items-view" AutoHeight="true" Border="false" Layout="FitLayout">
<Items>
<ext:DataView
ID="DataView1"
runat="server"
StoreID="DashBoardStore"
OverCls="x-view-over"
ItemSelector="div.item-wrap"
SingleSelect="true"
AutoHeight="true"
EmptyText="No items to display">
<Tpl ID="Template1" runat="server">
<Html>
<div id="items-ct">
<tpl for=".">
<div class="group-header">
<h2><div>{Title}</div></h2>
<dl>
<tpl for="Items">
<div class="item-wrap" ext:panel="{Accordion}" ext:menu="{MenuItem}">
<img src="{itemIcon}"/>
<div>
<H6>{Title}</H6>
</div>
</div>
</tpl>
<div style="clear:left"></div>
</dl>
</div>
</tpl>
</div>
</Html>
</Tpl>
<Listeners>
<SelectionChange Fn="selectionChanged" />
<ContainerClick Fn="viewClick" />
</Listeners>
</ext:DataView>
</Items>
</ext:Panel>
The Items portion doesn't work with the JasonReader in V2 but did work with the JasonReader with v1.x.If you use it, it will give you the internalid error. I have checked the data that is returned and it looks correct with respect the what the
Url method. The <Tpl> tag gives the internalid error when it tries to display the data. Your example for the grouping sample does not use a
IsComplex attribute. This is the reason it works. If I comment the IsComplex field, the dataview works properly. The problem is with children of the items field. It cannot deal with nested children or Complex based field types. I tried the XmlReader but that didn't work either. I think that the problem can be reproduced if the AjaxProxy tag is used in your grouping sample as I show above.
Last edited by geoffrey.mcgill; Sep 16, 2012 at 4:42 PM.
Reason: please use [CODE] tags