[CLOSED] passing values from one row to another row (related row)

  1. #1

    [CLOSED] passing values from one row to another row (related row)


    I have a gridpanel with add/delete button for inserting/deleting rows. The rows supposed to be interrelated. for example after the add button clicked, the EndTime in the first row should be passed as StartTime in the second rows and so on. Please help me on how to implement this. So far this is my code.

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <script type="text/javascript" id="igClientScript">
                 var getRowClass = function (record) {
                    if (record.phantom) {
                        return "new-row";
                    if (record.dirty) {
                        return "dirty-row";
                var insertRecord = function () {
                    var grid = <%= GridPanel1.ClientID %>;
                    var total= grid.store.getCount();
                    grid.store.insert(total, {});
                    grid.editingPlugin.startEdit(grid.store.getAt(total), grid.columns[0]);
                    var sm = grid.getSelectionModel();
    <body style="background-color: #DFE8F6">
    <form id="form1" runat="server">
            <table align="center" width="98%"><tr><td align="center">
                <ext:ResourceManager ID="ResourceManager1" runat="server" Locale="Client" DirectMethodNamespace="ActProduction"/>
                <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
                    Anchor="100% 100%">
                    <ext:GridPanel ID="GridPanel2" runat="server" fittoframe="true" AutoScroll="True" MaxHeight="250">
                                <ext:Toolbar ID="Toolbar1" runat="server">
                                        <ext:Button ID="btnAdd" runat="server" Text="Add" Icon="Add">
                                                <Click Fn="insertRecord" />
                                        <ext:ToolbarSeparator />
                                        <ext:Button ID="btnDelete" runat="server" Text="Delete" Icon="Exclamation">
                                                <Click Handler="#{GridPanel2}.deleteSelected(); #{UserForm}.getForm().reset();" />
                                <ext:Store ID="STR1"  runat="server">
                                    <ext:Model runat="server" ID="Model1">
                                            <ext:ModelField Name="StartTime" Type="Date" />
                                            <ext:ModelField Name="EndTime" Type="Date" />
                           <ColumnModel ID="ColumnModel2" runat="server" DefaultSortable="false">
                            <Columns><ext:DateColumn ID="Column1" runat="server" Text="Start Time" DataIndex="StartTime" Width="100" Format="H:i">
                                        <ext:TimeField  ID="edStartTime" runat="server" Format="H:i"/>
                                <ext:DateColumn ID="Column2" runat="server" Text="Time End" DataIndex="EndTime" Width="100" Format="H:i">
                                        <ext:TimeField  ID="edEndTime" runat="server" Format="H:i"/>
                            <ext:CellEditing ID="CellEditing4" runat="server" ClicksToEdit="1">
                                    <BeforeEdit Handler="
                                        if (e.value == null)
                                            e.value = '';">
                            <ext:GridView ID="GridView2" runat="server" StripeRows="true">
                                <GetRowClass Fn="getRowClass" />
    Last edited by Daniil; Aug 26, 2014 at 6:43 AM. Reason: [CLOSED]
  2. #2
    Hi @redi,

    You can iterate all the records and set its values as needed.
    store.each(function(record, index)) {
        record.set("field name", "new value");

Similar Threads

  1. Replies: 0
    Last Post: Aug 16, 2013, 7:28 AM
  2. [CLOSED] Passing values back from a GridPanel
    By gets_gui in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 30, 2013, 2:51 PM
  3. Passing ViewData values to BaseParams
    By mthird in forum 1.x Help
    Replies: 6
    Last Post: Feb 11, 2010, 4:40 PM
  4. Passing values from modal Window to parent
    By Rodriquez in forum 1.x Help
    Replies: 0
    Last Post: Oct 07, 2009, 10:21 AM
  5. [CLOSED] Passing values between tabs autoiframe method
    By speedstepmem2 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 20, 2008, 1:11 AM

Tags for this Thread

Posting Permissions