View Full Version : [CLOSED] passing values from one row to another row (related row)

Aug 20, 2014, 4:59 AM

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(tota l), 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" />

Aug 20, 2014, 11:58 AM
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");