PDA

View Full Version : Help Needed with RowEditor Gridpanel Rowclick event.



pooja
Apr 06, 2011, 1:06 PM
Hi All,

I am using the Row Editor in the Grid panel.
Using Listners i want the data of the row which is clicked.
So i used the RowClick Event but in the row click event i am getting Error as "record is undefined".




<ext:GridPanel ID="grdPnlNewEquipments" runat="server" Height="400" AutoExpandColumn="Store">
<Store>
<ext:Store ID="storeNewEquip" runat="server">
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="EquipID" Type="Int" Mapping="EquipID" />
<ext:RecordField Name="Salesmanno" Type="Int" Mapping="Salesmanno" />
<ext:RecordField Name="SalesmanName" Type="String" Mapping="SalesmanName" />
<ext:RecordField Name="Store" Type="String" Mapping="Store" />
<ext:RecordField Name="Month" Type="Int" Mapping="Month" />
<ext:RecordField Name="MonthName" Type="String" Mapping="MonthName" />
<ext:RecordField Name="Year" Type="Int" Mapping="Year" />
<ext:RecordField Name="EmployeeNotes" Type="String" Mapping="EmployeeNotes" />
<ext:RecordField Name="ManagementNotes" Type="String" Mapping="ManagementNotes" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
<Plugins>
<ext:RowEditor ID="RowEditor1" runat="server" SaveText="Update">
<Listeners>
<AfterEdit Handler=alert("Hi");/>
</Listeners>
</ext:RowEditor>
</Plugins>
<View>
<ext:GridView ID="GridView1" runat="server" MarkDirty="false" ForceFit="true" ScrollOffset="0">
</ext:GridView>
</View>
<Listeners>
</Listeners>
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>
<ext:Button ID="btnAddEquip" runat="server" Text="" Icon="Add">
<Listeners>
<Click Fn="addEquip" />
</Listeners>
</ext:Button>
<ext:Button ID="btnRemoveEquip" runat="server" Text="" Icon="UserDelete">
<Listeners>
<Click Fn="removeEquip" />
</Listeners>
</ext:Button>
<ext:ToolbarFill ID="tbFooter" runat="server">
</ext:ToolbarFill>
<ext:PagingToolbar ID="ptPaging" runat="server" PageSize="10" PageIndex="0" StoreID="storeNewEquip"
LabelAlign="Left">
</ext:PagingToolbar>
</Items>
</ext:Toolbar>
</TopBar>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
</ext:RowSelectionModel>
</SelectionModel>
<ColumnModel>
<Columns>
<ext:Column ColumnID="colEdit" Header="" Width="100" Align="Center">
<Renderer Fn="LinkEquipDetails" />
</ext:Column>
<ext:Column ColumnID="colEquipID" Header="EquipID" DataIndex="EquipID" Width="50"
Align="Center" Hidden="true">
<Editor>
<ext:TextField ID="TxtEquipID" runat="server" />
</Editor>
</ext:Column>
<ext:Column ColumnID="colSalesman" Header="Salesman" DataIndex="SalemanName" Width="100"
Sortable="true" Align="Center">
<Editor>
<ext:ComboBox ID="cmbSalesman" runat="server" DisplayField="SalesmanName" ValueField="Salesmanno">
<Store>
<ext:Store ID="storeSalesman" runat="server">
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="Salesmanno" Type="Int" Mapping="Salesmanno" />
<ext:RecordField Name="SalesmanName" Type="String" Mapping="SalesmanName" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
<Listeners>
<Select Handler="GetRecord(record)" />
</Listeners>
</ext:ComboBox>
</Editor>
</ext:Column>
<ext:Column ColumnID="colStore" Header="Store" DataIndex="Store" Width="100" Sortable="true"
Align="Center">
<Editor>
<ext:TextField ID="txtStore" runat="server" AllowBlank="true" />
</Editor>
</ext:Column>
<ext:Column ColumnID="colMonth" Header="Month" DataIndex="MonthName" Width="100"
Align="Center" Hidden="false">
<Editor>
<ext:ComboBox ID="cboMonth" runat="server" Editable="false" TypeAhead="true" Mode="Local"
ForceSelection="true" TriggerAction="All" DisplayField="MonthName" ValueField="MonthName">
<Store>
<ext:Store ID="storeMonth" runat="server">
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="Month" Type="Int" Mapping="Month" />
<ext:RecordField Name="MonthName" Type="String" Mapping="MonthName" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
</ext:ComboBox>
</Editor>
</ext:Column>
<ext:Column ColumnID="colYear" Header="Year" DataIndex="Year" Width="100" Sortable="true"
Align="Center">
<Editor>
<ext:ComboBox ID="cboYear" runat="server" Editable="false" TypeAhead="true" Mode="Local"
ForceSelection="true" TriggerAction="All" DisplayField="Year" ValueField="Year">
<Store>
<ext:Store ID="storeYear" runat="server">
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="Year" Type="Int" Mapping="Year" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
</ext:ComboBox>
</Editor>
</ext:Column>
<ext:Column ColumnID="colEmployeeNotes" Header="EmployeeNotes" DataIndex="EmployeeNotes"
Width="100" Sortable="true" Align="Center">
<Editor>
<ext:TextField ID="txtEmployeeNotes" runat="server" AllowBlank="true" />
</Editor>
</ext:Column>
<ext:Column ColumnID="colManagementNotes" Header="ManagementNotes" DataIndex="ManagementNotes"
Width="100" Sortable="true" Align="Center">
<Editor>
<ext:TextField ID="ManagementNotes" runat="server" AllowBlank="true" />
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
<Listeners>
<RowClick Handler="GetRow(record)" />
</Listeners>
</ext:GridPanel>



My Motive is i have a Combobox column colSalesman on selection of the combo box i need to update the Store column.
Please find attached screenshot for the same.