[ 2 posts ]

ispyinternet

  • Joined: Thu Jul 08, 2010 5:28 am
  • Posts: 111
  • Offline
  • Profile

Gallery Button Group alwaysSelected not working?

Post Posted: Tue Oct 04, 2011 7:40 am
+0-
Hi Satyam,

further to previous discussion, it seems I discovered that different button groups were not acting as one super toggle group (which I had initially thought was a problem), however there was a lack of styling to show the on state of a toggle button, I have added this into my code example, but now I am having problems with the alwaysSelected configuration parameter not appearing to do its job.

Please see my example at: http://jsfiddle.net/justgetmeon/3795e/1/

Once a toggle button is selected then within the group one should always remain selected? If you click again on the selected button, it will 'turn off' and the other button is already off, so now no button in the group is on.

Can you please clarify / advise.

Kind regards

Richard

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 2016
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • IRC: DevaSatyam
  • YUI Developer
  • Offline
  • Profile
Tags:

Re: Gallery Button Group alwaysSelected not working?

Post Posted: Tue Oct 04, 2011 8:56 am
+0-
It was a bug, sorry.

I have already fixed it and it will be available on the next gallery build. In the meantime, you may fix it by adding the following code before you define any of your button groups:

Y.ButtonGroup.prototype.bindUI = function() {
this.on(['button:press','buttonToggle:press'], this._onButtonPress ,this);
};

That code will work even after the gallery version is available (in fact, the gallery version will contain exactly this) so there is no hurry in deleting it, but do delete it eventually just in case further changes to this method come in the future and you miss them.

Thanks for finding it and reporting it so clearly.
  [ 2 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum