| Page 1 of 1 | [ 4 posts ] |
|
Hello,
I have started learning YUI3, unfortunately without much experience on YUI2. When using the on( event, ...) function, 'event' is a string representing the event name. So my question is. Given a Widget, how does one know which events are triggered by this widget? Maybe the answer is obvious but I have been able to find it ... Thanks Pandore |
|
I think it's probably better that you have no YUI2 experience; the transition from 2 to 3 is a radical one that can be hard to get used to.
You can get a rundown on all the events a particular component publishes by checking out the API documentation for the component. Widget, for example, defines "init", "destroy", "contentUpdate", and "render" events. Also, any component that makes use of the Attribute utility will fire events whenever one of their attributes change. These events take the form of "attributeNameChange", where "attributeName" is the name of the attribute that is changing. For example, if a component has an attribute "width", it would fire the event "widthChange" any time you called myComponent.set('width', someNewWidth) The documentation isn't perfect, but that should get you started for the common use cases. Also, check out the user guides and example code. Good luck! |
|
Thanks!
I want to display a data table and respond to row selection. I have not seen an attribute representing a selection (nor any event). Maybe data table is not the right widget? Nothing on data source neither. Should I listen to event fired by the "focused" attribute? Thank you Regards |
|
I did a little poking around, and it doesn't appear that the DataTable widget actively tracks the selected state of the elements within it. Depending on how complex your specific needs are, it might be easy to implement a plugin that would bootstrap this functionality onto the class, though.
|
| Page 1 of 1 | [ 4 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