View Full Version : [CLOSED] Problem in Date Format in Summary Column

May 15, 2013, 1:03 PM

i am using Gridpanel whichis using a SQl Query that returns some data with a Date in format (2013-05-13).
now when i am filling the store with the query it is returning Date in Some odd Format Like (01 01 2013T00:00:00)
i change some propety in model and Summary Column it is still not working properly

Design Code is

<ext:GridPanel ID="gpAssgDetails" Title="Assignments" Height="235" Icon="SitemapColor"
runat="server" ColumnLines="false">
<ext:Store ID="strEmpAssg" runat="server" GroupField="assg_desc">
<ext:Model ID="mdlAssgDetails" runat="server" IDProperty="pk_newEmpMapping">
<ext:ModelField Name="assg_validfrom" Type="Date" DateReadFormat="dd/MM/yyyy" DateWriteFormat="dd/MM/yyyy" >
<ext:ModelField Name="assg_validto" Type="Date" DateReadFormat="dd/MM/yyyy" DateWriteFormat="dd/MM/yyyy" >
<ColumnModel ID="cmEmpAssg" runat="server">
<ext:SummaryColumn ID="assg_validfrom" DataIndex="assg_validfrom" SummaryType="None"
runat="server" Sortable="true" Text="Valid From" DateFormat="dd/MM/yyyy" >
<ext:SummaryColumn ID="assg_validto" DataIndex="assg_validto" SummaryType="None"
runat="server" Sortable="true" Text="Value To" DateFormat="dd/MM/yyyy">

<ext:GridView ID="gvAssgView" runat="server" StripeRows="true" MarkDirty="false" />
<ext:GroupingSummary ID="gsAssgDetails" runat="server" GroupHeaderTplString='{columnName}: {name} ({rows.length} Element{[values.rows.length > 1 ? "s" : ""]})'
HideGroupedHeader="true" EnableNoGroups="true" EnableGroupingMenu="true" />

after this code ..Date Format is "Tue Mar 12 2013 00:00:00 GMT+530(INDIAN STANDARD TIME)"
please Help Me.... I just need 12/12/2013 or12-12-2013...

May 15, 2013, 2:42 PM
Please set ModelField's Type and DateFormat properties as shown below:

<ext:Store runat="server">
<ext:Model runat="server">
<ext:ModelField Name="PropertyA" Type="Date" DateFormat="M/d hh:mmtt" />

Please take a look on the following example:

I would also recommend you take a look on the following page:

May 16, 2013, 5:12 AM
i tries DateFormat="M/d hh:mmtt" also , but on using it..my Gridpanel does not show any thing.. it goes blank...!

May 16, 2013, 5:40 AM
Hi @Tonic,

Please use a SummaryColumn's Renderer instead of its DateFormat. A SummaryColumn doesn't support DateFormat.


<ext:SummaryColumn runat="server">
<Renderer Format="Date" FormatArgs="'d/m/Y'" />

May 16, 2013, 6:37 AM
i used

<ext:SummaryColumn ID="classg_validfrom" runat="server" DataIndex="assg_validfrom"
Text="Valid From">
<Renderer Format="Date" FormatArgs="'d/m/Y'" />
<ext:SummaryColumn ID="classg_validto" runat="server" DataIndex="assg_validto"
Text="Valid Till">
<Renderer Format="Date" FormatArgs="'d/m/Y'" />

with model field

<ext:ModelField Name="assg_validfrom">
<ext:ModelField Name="assg_validto" >

but it is not working..
i have attached a image please look it , u will get some idea...

i need simple format like "mm/dd/yyyy".
please suggest me..

May 16, 2013, 7:23 AM
I did in the way you suggested... and it is working..