Feb 19, 2014, 1:36 PM
Group By a Date Type Makes Row Selection impossible
I have found that grouping a gridpanel by strings and integers works perfectly and exactly as desired in the examples. However, if the groupfield tag is set to a model property that is a defined Type="Date" it renders the RowSelection inactive except on the first row of data in each group.
<Store>
<ext:Store ID="Store2" runat="server" DataSourceID="linqsource1" GroupField="shipdate">
<Model>
<ext:Model ID="Model2" runat="server" >
<Fields>
<ext:ModelField Name="mrcID" Type="String"/>
<ext:ModelField Name="itemID" Type="String"/>
<ext:ModelField Name="shipto" Type="String"/>
<ext:ModelField Name="shipdate" Type="Date"/>
<ext:ModelField Name="bpolineID" Type="String"/>
<ext:ModelField Name="orderqty" Type="Int"/>
<ext:ModelField Name="shipped" Type="Int"/>
<ext:ModelField Name="received" Type="Int"/>
<ext:ModelField Name="itemdesc" Type="String"/>
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
It is easily worked around though. I was able to group by date by defining it a String in the Model, then customize it's appearance in the header by referencing the data in the template of my GroupingSummary. <Store>
<ext:Store ID="Store2" runat="server" DataSourceID="linqsource1" GroupField="shipdate">
<Model>
<ext:Model ID="Model2" runat="server" >
<Fields>
<ext:ModelField Name="mrcID" Type="String"/>
<ext:ModelField Name="itemID" Type="String"/>
<ext:ModelField Name="shipto" Type="String"/>
<ext:ModelField Name="shipdate" Type="String"/>
<ext:ModelField Name="bpolineID" Type="String"/>
<ext:ModelField Name="orderqty" Type="Int"/>
<ext:ModelField Name="shipped" Type="Int"/>
<ext:ModelField Name="received" Type="Int"/>
<ext:ModelField Name="itemdesc" Type="String"/>
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ext:GroupingSummary ID="GroupingSummary1"
runat="server" HideGroupedHeader="false" StartCollapsed="false"
GroupHeaderTplString="{[Ext.util.Format.date([values.rows[0].data.shipdate],'Y/m/d')]}">
</ext:GroupingSummary>