View Full Version : [CLOSED] Prevent default action in radio group not working

Nov 16, 2015, 10:28 PM
Hello, why is this not working? (the radio gets selected every time, it shouldn't)

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
if (!X.IsAjaxRequest)


<!DOCTYPE html>

<head runat="server">

<script type="text/javascript">
var change = function (item) {

<ext:ResourceManager runat="server" />

<ext:RadioGroup runat="server" FieldLabel="Rating" ColumnsNumber="3" AutomaticGrouping="false">
<ext:Radio runat="server" Name="rating" InputValue="0" BoxLabel="A" ReadOnly="false" />
<ext:Radio runat="server" Name="rating" InputValue="1" BoxLabel="B" ReadOnly="false" />
<ext:Radio runat="server" Name="rating" InputValue="2" BoxLabel="C" ReadOnly="false" />

<Change Handler="change(item);" PreventDefault="False" StopEvent="True" StopPropagation="True"></Change>

Nov 17, 2015, 8:57 AM
Hi @exe,

I think the Change event fires when a Radio's state is already changed and the event is not meant to be able to prevent it.

As far as I can see there is no BeforeChange event in API.

I can suggest this solution.

<ext:Radio ...>
<AfterRender Handler="this.onBoxClick = Ext.Function.createInterceptor(this.onBoxClick, beforeOnBoxClick);" />

var beforeOnBoxClick = function (e) {
if (true) { // Prevent condition
return false;

Nov 17, 2015, 3:06 PM
The workaround is working as expected.