[CLOSED] Interceptor for checkbox check event

  1. #1

    [CLOSED] Interceptor for checkbox check event

    Hi,

    On checkbox, while the user clicks on Checkbox, we have to show a confirmation message. If user accepts, we need to go ahead check the checkbox. Otherwise, we should not check the checkbox.

    Is there a way to intercept the check event of Checkbox?
    Last edited by Daniil; Dec 23, 2011 at 8:19 AM. Reason: [CLOSED]
  2. #2
    Hi,

    I can suggest the following solution.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    
        <script type="text/javascript">
            var setValueSilent = function (checkbox, checked) {
                checkbox.suspendEvents();
                checkbox.setValue(checked);
                checkbox.resumeEvents();    
            };
    
            var onCheck = function (checkbox, checked) {
                setValueSilent(checkbox, !checked);
                Ext.Msg.confirm('Confirm', 'Confirm?', function (btn) {
                    if (btn === 'yes') {
                        setValueSilent(checkbox, checked);
                    }
                });
                Ext.Msg.getDialog().alignTo(Ext.EventObject.getTarget());
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Checkbox runat="server">
                <Listeners>
                    <Check Fn="onCheck" />
                </Listeners>
            </ext:Checkbox>
        </form>
    </body>
    </html>
  3. #3

    Interceptor for checkbox check event

    Thank You. This is exactly what I was looking for. You can close this thread.

Similar Threads

  1. [CLOSED] Check all checkbox for TreeGrid
    By bakardi in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 04, 2012, 7:25 AM
  2. [CLOSED] How to handle the Checkbox Check client event?
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Feb 08, 2012, 12:18 PM
  3. Checkbox Check Event
    By mjessup in forum 1.x Help
    Replies: 2
    Last Post: Jun 16, 2010, 10:08 PM
  4. Replies: 1
    Last Post: Aug 13, 2009, 9:37 AM
  5. Replies: 0
    Last Post: Jul 26, 2009, 12:42 AM

Posting Permissions