HZGN.COM
welcome to my space
X
Search:  
Welcome to:hzgn.com
NAVIGATION - HOME

[SOLVED] [2.0] Ext.Action and Toggle button

Published by: mike 2009-01-07

  • Hello,

    I have a toggle button that I use in more than one place. I would like to have the state of the toggle button updated across all copies of the button. I am currently using Ext.Action, but the toggle method is not a standard action, so the state doesn't get copied to all occurrences of the button.

    I tried extending the Ext.Action to handle the toggle method, but I think I'm missing something. Here's what I tried:
    Ext.ux.ActionToggle = Ext.extend(Ext.Action, {
    toggle: function(state) {
    this.initialConfig.pressed = state;
    this.callEach('toggle', [state]);
    }
    });

    This didn't do the trick. I used Firebug and found that this method never gets called. Any ideas what I'm doing wrong? Any suggestion on how to update the toggle state of all toggle buttons?
    Making the X Window System Accessible to People with Disabilities::
    For example, if a toggle button were to get input focus in a dialog box, which is the Disability Action Committee for X. All implementations will be
    http://trace.wisc.edu/docs/x_win_disability/x_disabl.htm
    HOME

    Firefox 2.0 annoyances [Archive] - Ubuntu Forums::
    31 posts - Last post: Aug 7, 2007[Archive] Firefox 2.0 annoyances General Help. Secondly, I have set files to perform a certain action when clicked but they don't even
    http://ubuntuforums.org/archive/index.php/t-288048.html
    HOME
    Thanks,
    Tim


  • Sorry Brian, I should have posted a little more code.

    You're correct. My extend code was fine. The problem was that I wasn't calling the action.toggle method in the toggleHandler event.

    I checked the source of the button control before posting and found that the toggle method is called before the toggleHandler handler function, and I thought this would do it. I wasn't differentiating the button.toggle method and the action.toggle method, but I think I understand now.

    Thanks,
    Tim


  • That looks fine so far. Since you didn't post any other code, there's no telling what your issue is. However, this should work:

    Ext.ux.ToggleAction = Ext.extend(Ext.Action, {
    toggle: function(state) {
    this.initialConfig.pressed = state;
    this.callEach('toggle', [state]);
    }
    });

    Ext.onReady(function(){
    var toggler = new Ext.ux.ToggleAction({
    enableToggle: true,
    text: 'Toggle me!',
    renderTo: document.body,
    toggleHandler: function(btn, state){
    this.setText('Toggled = '+state);
    toggler.toggle(state);
    }
    });

    var btn = new Ext.Button(toggler);
    var btn2 = new Ext.Button(toggler);
    var btn3 = new Ext.Button(toggler);
    });





  • Red Hat's Rough Recovery From CFO Exit
    Windows Live Finds a New, Pre-installed Home

    PRINT Add to favorites
    #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about [SOLVED] [2.0] Ext.Action and Toggle button , Please add it free.
  • three new additions
  • my electric stamp
  • one for the k man
  • the exorcist classic image
  • theones stamp
  • my stamp entry
  • here´s mine
  • abstract by butters
  • coolest stamp ever lol
  • cool stamp
  • pixel monkey
  • one for the k man
  • lost doll thread
  • fast food stamps
  • mordaut s stamps
  • evil monkey
  • sammo s 0 04
  • photostamps
  • ya3 mutilated msn logo
  • first entry feedback welcomed
  • k post the only wat to post
  • banda aceh
  • pixel monkey
  • if your stamp hasn t been added yet
  • my first one awesomeness
  • ransom letters
  • are you the chosen one stamp
  • banda aceh
  •  Homepage | Add to favorites | Contact us | Exchange links | LOGIN | Site map | 
    Copyright© 2008 hzgn.com        Site made:CFZ