[CLOSED] How to handle the Checkbox Check client event?

  1. #1

    [CLOSED] How to handle the Checkbox Check client event?

    Hi,

    A Checkbox in a form panel is bound to the grid's CheckColumn on a page. I have a Check listener attached to the checkbox in the markup that should enable a few buttons in response to the Check event triggered by the user. However, the Check event is fired every time when the grid is loaded. I've attempted to leverage the Change listener but it fires only when the focus shifts away from the Checkbox.

    Is there any way to handle this situation so that only user-triggered check event on the Checkbox is handled?

    Thanks,

    Vadym
    Last edited by Daniil; Feb 08, 2012 at 12:24 PM. Reason: [CLOSED]
  2. #2
    Hi,

    This way:

    Example
    <ext:Checkbox runat="server" DataIndex="test3">
        <Listeners>
            <AfterRender Handler="this.el.on('change', function (e, el) { alert(el.checked); });" />
        </Listeners>
    </ext:Checkbox>
  3. #3
    Thanks Daniil!

    That works great doing exactly what I need!

    In the process, I learned that I can't have more than one field in the databound form with the same DataIndex. I couldn't understand why a checkbox in a form panel wouldn't get data bound from the grid master record until I realized that there was already a form field with the same DataIndex. I guess, that shouldn't be allowed.

    Vadym
  4. #4
    Yes, DataIndex must be unique.
  5. #5
    Hi Daniil,

    The AfterRender handler still requires that the checkbox focus be lost to fire in IE8 (it's OK in IE9 and other major browsers' latest versions) . Is there any tweak for IE8?

    Thanks,

    Vadym
  6. #6
    Please use "click" instead of "change".

    Example
    this.el.on('click', function (e, el) { alert(el.checked); });
  7. #7
    Quote Originally Posted by Daniil View Post
    Please use "click" instead of "change".

    Example
    this.el.on('click', function (e, el) { alert(el.checked); });
    Thanks Daniil! That meets the requirement for both IE8 and IE9!

    Vadym

Similar Threads

  1. Replies: 2
    Last Post: Sep 12, 2012, 10:28 AM
  2. [CLOSED] Interceptor for checkbox check event
    By Aparna_B in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 23, 2011, 4:39 AM
  3. Checkbox Check Event
    By mjessup in forum 1.x Help
    Replies: 2
    Last Post: Jun 16, 2010, 10:08 PM
  4. [CLOSED] checkbox check client side
    By majestic in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 24, 2009, 4:13 AM
  5. Replies: 0
    Last Post: Jul 26, 2009, 12:42 AM

Posting Permissions