I want to change Grid Date column dynamically?

  1. #1

    I want to change Grid Date column dynamically?

    I have GirdPanel with Two date columns "FromDate" and "ToDate". Initially values are store from Database.

    Below the Grid I have two DateField Controls - From Date and To Date. If I change the date value in this control. I want to update values to Grid Panel Date columns respectively.

    <table width="90%" align="center" border="1" cellspacing="5" cellpadding="1">
    <tr>
        <td colspan="6" width="100%" style="width:auto; height:auto; padding-bottom:5px" >    
               <ext:Store ID="gvNewspaperStoreId" runat="server">
                        <AutoLoadParams>
                            <ext:Parameter Name="start" Value="0" Mode="Raw" />
                            <ext:Parameter Name="limit" Value="10" Mode="Raw" />
                        </AutoLoadParams>
                    <Reader>
                        <ext:JsonReader IDProperty="MFMaterialId">
                            <Fields>                        
                                <ext:RecordField Name="MFMaterialId" />
                                <ext:RecordField Name="SequenceOrderNo" />
                                <ext:RecordField Name="MFMaterialName" />                            
                                <ext:RecordField Name="BidNo" />
                                <ext:RecordField Name="MFMaterialType" />
                                <ext:RecordField Name="FromDate"></ext:RecordField>
                                <ext:RecordField Name="ToDate"></ext:RecordField>
                                <ext:RecordField Name="NoofDays"></ext:RecordField>
                                <ext:RecordField Name="Remarks"></ext:RecordField>
                                <ext:RecordField Name="Mastercopy"></ext:RecordField>
                                <ext:RecordField Name="DDUP"></ext:RecordField>
                                <ext:RecordField Name="DUP"></ext:RecordField>
                            </Fields>
                        </ext:JsonReader>
                    </Reader>
                </ext:Store>
    
               <ext:GridPanel 
                    ID="gvNewspaper" 
                    runat="server" StoreID="gvNewspaperStoreId" Hidden="true" Height="300" AutoWidth="true"> 
                    <Listeners>
                        <KeyDown Fn="startEditing" />
                        <%--<AfterEdit Fn="afterEdit" />--%>
                        <AfterEdit Fn="ComputeDate" />                    
                    </Listeners>
                    <ColumnModel runat="server">                
                        <Columns>
                                <ext:Column DataIndex="SequenceOrderNo" Header="Sn" Width="30px"></ext:Column>
                                <ext:Column DataIndex="MFMaterialName" Header="Titles" Width="180" />
                                <ext:Column DataIndex="FromDate" Header="From Date">                             
                                <Editor>                                            
                                    <ext:DateField ID="gvNwdtFromDate" runat="server" Format="dd/MM/yyyy" Vtype="daterange">
                                     <CustomConfig>
                                        <ext:ConfigItem Name="endDateField" Value="#{gvNwdtToDate}" Mode="Value"></ext:ConfigItem>
                                     </CustomConfig>
                                    </ext:DateField>
                                </Editor>
                                </ext:Column>
    
                                <ext:Column DataIndex="ToDate" Header="To Date">
                                <Editor>
                                    <ext:DateField ID="gvNwdtToDate" runat="server" Format="dd/MM/yyyy" Vtype="daterange">
                                     <CustomConfig>
                                        <ext:ConfigItem Name="startDateField" Value="#{gvNwdtFromDate}" Mode="Value"></ext:ConfigItem>
                                     </CustomConfig>
                                    </ext:DateField>
                                </Editor>
                                </ext:Column>
                                
                                <ext:Column ColumnID="gvNoofDays" DataIndex="NoofDays" Header="#Days" Width="50">
                                <Editor>
                                    <ext:NumberField ID="gvtxtNwNoOfDays" runat="server" Width="50" Enabled="false" ReadOnly="true"></ext:NumberField>
                                </Editor>                            
                                </ext:Column>
                                <ext:Column DataIndex="Remarks" Header="Remarks" Width="260">
                                <Editor>
                                    <ext:TextField ID="gvtxtNwRemarks" runat="server"></ext:TextField>
                                </Editor>                                                        
                                </ext:Column>
                                <ext:Column DataIndex="Mastercopy" Header="Master" Width="50">
                                <Editor>
                                    <ext:NumberField ID="gvtxtNwMaster" runat="server" Width="50"></ext:NumberField>
                                </Editor>                                                        
                                </ext:Column>
                                <ext:Column DataIndex="DDUP" Header="DDUP"  Width="50">
                                <Editor>
                                    <ext:NumberField ID="gvtxtNwDDUP" runat="server" Width="50"></ext:NumberField>
                                </Editor>                            
                                </ext:Column>
                                <ext:Column DataIndex="DUP" Header="DUP"  Width="50">
                                <Editor>
                                    <ext:NumberField ID="gvtxtNwDUP" runat="server" Width="50"></ext:NumberField>
                                </Editor> 
                                </ext:Column>
                        </Columns>
                    </ColumnModel>
    
                    <SelectionModel>
                        <ext:CheckboxSelectionModel runat="server"></ext:CheckboxSelectionModel>
                    </SelectionModel>
    
                    <BottomBar>
                        <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="10" />
                    </BottomBar>
    
                </ext:GridPanel>
        </td>
    </tr>
    </table>
          <table width="100%" cellspacing="3">
            <tr>
            <td width="380px" valign="middle">
                    <ext:FieldSet ID="FieldSet1" runat="server" Title="Assign Date for Selected Items">                
                       <Content>                    
                        <table width="100%" style="vertical-align:middle" cellspacing="3" cellpadding="2">
                            <tr>
                                <td valign="middle"><ext:Label ID="lblFromDate" Text="From Date :" runat="server"></ext:Label></TD>
                                <td>
                                    <ext:DateField ID="dtFromaDate" runat="server" Vtype="daterange" Format="dd/MM/yyyy">
                                     <CustomConfig>
                                        <ext:ConfigItem Name="endDateField" Value="#{dtToDate}" Mode="Value"></ext:ConfigItem>
                                     </CustomConfig>
                                    </ext:DateField>
                                </td>
                                <td valign="middle">
                                <ext:Label ID="lblToDate" Text="To Date :" runat="server"></ext:Label></TD>
                                <td>
                                     <Listeners>                            
                                        <Change Fn ="Datediff" />                                   
                                        <%--<Change Handler="Ext.net.DirectMethods.Datediff();" />--%>
                                     </Listeners>
                                     <CustomConfig>
                                        <ext:ConfigItem Name="startDateField" Value="#{dtFromaDate}" Mode="Value"></ext:ConfigItem>
                                     </CustomConfig>
                                     </ext:DateField>                        
                                </td>    
                            </tr>
                        </table>
                        </Content>
                       </ext:FieldSet>        
            </td>
        </tr>
        </table>
    Last edited by Daniil; Feb 15, 2012 at 10:15 AM. Reason: Please use [CODE] tags

Similar Threads

  1. Replies: 2
    Last Post: Jan 23, 2012, 11:49 AM
  2. [CLOSED] Trying to dynamically change grid panel columns.
    By GLD in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 29, 2011, 9:41 AM
  3. [CLOSED] How to change grid column values dynamically?
    By Etisbew in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Oct 19, 2009, 3:49 PM
  4. Can't change date format in grid
    By dbassett74 in forum 1.x Help
    Replies: 2
    Last Post: Apr 20, 2009, 2:15 PM
  5. Replies: 2
    Last Post: Feb 19, 2009, 3:02 PM

Posting Permissions