[CLOSED] Date Value is not getting formatted during Edit mode in Grid Panel

  1. #1

    [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.

    function NewRow() {
    var rowIndex = GrdPnl1.addRecord();
    var record = GrdPnl1.store.getAt(rowIndex);
    record.data.qdelivery_date_from = "06-08-2010";
    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">
    <ext:JsonReader ReaderID="Key">
    <ext:RecordField Name="qdelivery_date_to" Type="Date" DateFormat="dd-MM-yyyy" />
    <ext:RecordField Name="qdelivery_date_from" Type="Date" DateFormat="dd-MM-yyyy" />
    This is My Grid:
    <ext:GridPanel ID="GrdPnl1" runat="server" StoreID="storePriceInquiry" Border="false"
    AutoScroll="true" ClicksToEdit="2">
    <ColumnModel ID="ColumnModel1" runat="server">
    <ext:Column Header="ETD" Sortable="true" DataIndex="qdelivery_date_to" ColumnID="delivery-date"
    <ext:DateField ID="Date_Etd_to" AllowBlank="false" runat="server" Width="175" Cls="manitatory" DataIndex="qdelivery_date_to">
    <ext:Column Header="ETD_From" Sortable="true" DataIndex="qdelivery_date_from" ColumnID="delivery-date"
    <ext:DateField ID="Date_Etd" AllowBlank="false" runat="server" Width="175" Cls="manitatory" DataIndex="qdelivery_date_from">
    <ext:GridView ID="GridView1" ForceFit="false" runat="server" EnableRowBody="false">
    <ext:CheckboxSelectionModel HideCheckAll="true" ID="CheckboxSelectionModel1" runat="server">
    <ext:GridPanelMaintainScrollPositionOnRefresh ID="GridPanelMaintainScrollPositionOnRefresh1"
    <ext:Button ID="btnAdd" runat="server" Text="Add" AutoPostBack="false" IconCls="add">
    <Click Handler="NewRow()" />
    <ext:PagingToolbar ID="PagingToolBar1" runat="server" StoreID="storePriceInquiry"
    DisplayInfo="true" PageSize="10" />
    Last edited by geoffrey.mcgill; Aug 12, 2010 at 10:01 PM. Reason: please use [CODE] tags
  2. #2

    Please try the following code
    function NewRow() {
        var rowIndex = GrdPnl1.addRecord();
        var record = GrdPnl1.store.getAt(rowIndex);
        record.set("qdelivery_date_from", new Date(2010, 8, 6));
        GrdPnl1.startEditing(rowIndex, 0);
    Vladimir Shcheglov
    Sr. Developer

Similar Threads

  1. [CLOSED] Detect Grid Edit Mode
    By rthiney in forum 1.x Premium Help
    Replies: 4
    Last Post: Aug 25, 2011, 7:18 PM
  2. Replies: 7
    Last Post: Aug 12, 2011, 2:30 PM
  3. Replies: 4
    Last Post: Jun 30, 2011, 3:30 PM
  4. Replies: 3
    Last Post: Jun 03, 2011, 12:10 PM
  5. Replies: 2
    Last Post: Oct 05, 2010, 10:29 AM

Posting Permissions