Feb 07, 2013, 6:16 AM
[CLOSED] Render functions for Radio Button in Editable Grid works correctly in IE 8 but doesnt work on Chrome
Hi,
I have a Editable grid, where the first column is a radio button column where I have written code for single radio button selection at a time.
The code for the same is mentioned below. The below code works fine on IE 8 , but it is not working on chrome.
While debugging, I observed that the break point at Render and After Render functions are not hit consistently in chrome, while on IE is consistently hit and the radio button gets focused correctly every time user selects a radio button.
Can you please take a look and suggest?
I have a Editable grid, where the first column is a radio button column where I have written code for single radio button selection at a time.
The code for the same is mentioned below. The below code works fine on IE 8 , but it is not working on chrome.
While debugging, I observed that the break point at Render and After Render functions are not hit consistently in chrome, while on IE is consistently hit and the radio button gets focused correctly every time user selects a radio button.
Can you please take a look and suggest?
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
var actionPerformed = false;
var rdoPrimaryRender = function () {
this.focus();
};
var rdoPrimaryAfterRender = function () {
setTimeout(function () {
this.focus();
}, 0.0001);
}
var OnRadioButtonChange = function (rdbtnPrimaryContact, grdAssignedUsers) {
actionPerformed = true;
setTimeout(function () {
for (var i = 0; i < grdAssignedUsers.getStore().data.length; i++) {
var element = Ext.get(grdAssignedUsers.getView().getRow(i));
var record = grdAssignedUsers.getStore().getAt(i);
record.set("PrimaryContact", false);
}
this.focus();
}, 0.5);
};
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager2" runat="server" />
<div>
<ext:Store ID="AssignedUsersStore" runat="server" WarningOnDirty="false" AutoLoad="true">
<Proxy>
<ext:HttpProxy Url="/Company/GetAssignedUsers" />
</Proxy>
<Reader>
<ext:JsonReader IDProperty="ID" Root="data" TotalProperty="total">
<Fields>
<ext:RecordField Name="ID" />
<ext:RecordField Name="Name" />
<ext:RecordField Name="PrimaryContact" />
</Fields>
</ext:JsonReader>
</Reader>
<BaseParams>
<ext:Parameter Name="departmentID" Value='SelectedDepartmentID'
Mode="Raw" />
</BaseParams>
<Listeners>
</Listeners>
</ext:Store>
<ext:FormPanel runat="server" ID="pnlSample" Width="500" Height="400">
<Items>
<ext:GridPanel runat="server" ID="grdAssignedUsers" EnableDragDrop="true" Title="AssignedDepartmentUser"
AutoExpandColumn="Name" DDGroup="secondGridDDGroup" IDMode="Explicit" StoreID="AssignedUsersStore"
StripeRows="true" EnableColumnHide="false">
<ColumnModel ID="cmodAssignedUsers" runat="server">
<Columns>
<ext:Column ColumnID="PrimaryContact" Header="PrimaryContact" DataIndex="PrimaryContact">
<Editor>
<ext:Radio ID="rdbtnPrimaryContact" runat="server">
<Listeners>
<Render Fn="rdoPrimaryRender" />
<AfterRender Fn="rdoPrimaryAfterRender" />
<Check Handler="OnRadioButtonChange(#{rdbtnPrimaryContact},#{grdAssignedUsers});" />
</Listeners>
</ext:Radio>
</Editor>
</ext:Column>
<ext:Column Width="100" ColumnID="UserFullName" Header="UserFullName" Tooltip="UserFullName"
AutoDataBind="true" DataIndex="Name" />
<ext:Column Width="100" ColumnID="UserID" Header="ID" AutoDataBind="true" DataIndex="ID"
Hidden="true" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel2" runat="server" />
</SelectionModel>
<View>
<ext:GridView ForceFit="true" />
</View>
<Plugins>
<ext:EditableGrid ID="eg1" runat="server" />
<ext:GridFilters runat="server" ID="GridFilters2">
<Filters>
<ext:StringFilter DataIndex="Name" />
</Filters>
</ext:GridFilters>
</Plugins>
</ext:GridPanel>
</Items>
</ext:FormPanel>
</div>
</form>
</body>
</html>
Last edited by Daniil; Feb 19, 2013 at 3:32 AM.
Reason: [CLOSED]