Aug 11, 2010, 12:45 PM
[CLOSED] Date Value is not getting formatted during Edit mode in Grid Panel
I want to Add a New Row in the Grid, I am using following function for that.
This is My Store:
-------------------
function NewRow() {
var rowIndex = GrdPnl1.addRecord();
var record = GrdPnl1.store.getAt(rowIndex);
record.data.qdelivery_date_from = "06-08-2010";
GrdPnl1.getView().refreshRow(rowIndex);
GrdPnl1.getView().focusRow(parseInt(rowIndex));
GrdPnl1.startEditing(parseInt(rowIndex),0);
}
The problem is it shows 08-06-2010 during focus on first cell, if i move focus to the cell ETD_From it shows 06-08-2010 and lost focus from the cell it shows 06-08-2010, i want the value 06-08-2010 during the first time itself :confused:, pls help me on this.This is My Store:
-------------------
<ext:Store ID="storePriceInquiry" runat="server" IgnoreExtraFields="true" WarningOnDirty="false">
<Reader>
<ext:JsonReader ReaderID="Key">
<Fields>
<ext:RecordField Name="qdelivery_date_to" Type="Date" DateFormat="dd-MM-yyyy" />
<ext:RecordField Name="qdelivery_date_from" Type="Date" DateFormat="dd-MM-yyyy" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
This is My Grid:
-----------------
<ext:GridPanel ID="GrdPnl1" runat="server" StoreID="storePriceInquiry" Border="false"
AutoScroll="true" ClicksToEdit="2">
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column Header="ETD" Sortable="true" DataIndex="qdelivery_date_to" ColumnID="delivery-date"
MenuDisabled="true">
<Editor>
<ext:DateField ID="Date_Etd_to" AllowBlank="false" runat="server" Width="175" Cls="manitatory" DataIndex="qdelivery_date_to">
</ext:DateField>
</Editor>
</ext:Column>
<ext:Column Header="ETD_From" Sortable="true" DataIndex="qdelivery_date_from" ColumnID="delivery-date"
MenuDisabled="true">
<Editor>
<ext:DateField ID="Date_Etd" AllowBlank="false" runat="server" Width="175" Cls="manitatory" DataIndex="qdelivery_date_from">
</ext:DateField>
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
<View>
<ext:GridView ID="GridView1" ForceFit="false" runat="server" EnableRowBody="false">
</ext:GridView>
</View>
<SelectionModel>
<ext:CheckboxSelectionModel HideCheckAll="true" ID="CheckboxSelectionModel1" runat="server">
</ext:CheckboxSelectionModel>
</SelectionModel>
<Plugins>
<ext:GridPanelMaintainScrollPositionOnRefresh ID="GridPanelMaintainScrollPositionOnRefresh1"
runat="server">
</ext:GridPanelMaintainScrollPositionOnRefresh>
</Plugins>
<Buttons>
<ext:Button ID="btnAdd" runat="server" Text="Add" AutoPostBack="false" IconCls="add">
<Listeners>
<Click Handler="NewRow()" />
</Listeners>
</ext:Button>
</Buttons>
<BottomBar>
<ext:PagingToolbar ID="PagingToolBar1" runat="server" StoreID="storePriceInquiry"
DisplayInfo="true" PageSize="10" />
</BottomBar>
</ext:GridPanel>
Last edited by geoffrey.mcgill; Aug 12, 2010 at 10:01 PM.
Reason: please use [CODE] tags