This support forum belongs to the Button and ButtonToggle Gallery Module.
Button and ButtonToggle has a bug tracker here: https://github.com/Satyam/yui3-new-gallery/issues
| Page 1 of 1 | [ 2 posts ] |
|
Hi Satyam, may I request a configuration option for a button group of toggle buttons so that if I have a group of toggle buttons, I can default one of them to the 'on' state. Not sure exactly how this would work, currently I am doing something like this for a show hide columns dialogue on yui3 datatable:
buttonGroup = (new Y.ButtonGroup( { alwaysSelected : true, children: [ new Y.ButtonToggle({label:'Show'}), new Y.ButtonSeparator(), new Y.ButtonToggle({label:'Hide'}) ] } ) ).render(insertNode.one(".showhide_panel-pickerbtns")); if(dataTableNode.one(".yui3-column-" + columns.keys[i].get("key")).hasClass("showHideColumn-Hide")) { buttonGroup.item(2).set("selected",1); buttonGroup.item(2).get("srcNode").addClass(buttonGroup.item(2)._classNames['selected']); } else { buttonGroup.item(0).set("selected",1); buttonGroup.item(0).get("srcNode").addClass(buttonGroup.item(2)._classNames['selected']); } But I dont suppose this solution is ideal as it is not relying on any public methods! Kind regards Richard. |
|
I guess that you could do:
buttonGroup.item(2).fire('press'); which would simulate a key press, with all its consequences. You might want to check this sample code, it is a very lightweight button set, it just plugs into Node so that you actually create buttons, toggles or groups via HTML and then tell this simple plugin to add toggling and grouping to those same nodes. It is very small, the following file contains the demo and the plugin itself which is a very small part of it. It relies on classes on the HTML itself to know which button is which. Then, you just use Node to do whatever you want with them. http://satyam.com.ar/yui/3.5/button/usingATTRS.html http://satyam.com.ar/yui/3.5/button/usingATTRS.html |
| Page 1 of 1 | [ 2 posts ] |
| 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 |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group