> The roles are for ARIA. OK. I'll have to read this :)
> We're not storing data here, we're modifying the actual scroll > position. DOH! Not paying attention. That explains it. > Don't do either, store data as properties on your plugin instance. I use a 'state' object for internal data, but add 2 data-flags (layoutRole and layoutEdge) to widget 'sub-elements' so I can query these when one instance of the widget is placed inside another (like Tabs within a Tab within a Tab). It also is useful for generic events on these elements. Since these sub-elements are not the 'widget element', I cannot access the widget instance or properties through them. But I do want to find a way to do so because it would be useful. For example, it would simplify synchronized-resizing with other widgets, like the Accordion. But I'll figure that out later. ;) Thanks Jorn and Scott for the info. /Kevin On Aug 31, 6:34 am, Scott González <[email protected]> wrote: > On Aug 30, 2:11 pm, Kevin Dalman <[email protected]> wrote: > > > I have some unrelated questions about expando properties... > > > I notice that many widgets set a 'role' attribute on the element(s). > > Is this related to ARIA or a similar standard? Is it recommended that > > a role be set on widget elements? If so, are there any naming > > convention to follow? (Sorry if this is in the ARIA documentation - > > haven't gotten to that yet) > > > > I also notice that some widgets uses attributes to store data, like > > ui.dialog... > > > var saveScroll = { scrollTop: this.element.attr('scrollTop'), > > scrollLeft: this.element.attr('scrollLeft') }; > > this.element.attr(saveScroll); > > We're not storing data here, we're modifying the actual scroll > position. > > > I just *removed* all expando properties and switched to using $ > > (elem).data(...) instead. The only expando I kept is for users to hard- > > code an 'instance name' on button-elements to facilitate auto-binding, > > but I treat this attribute as 'read-only'. > > > Is there any widget guideline for using data() VS attributes? I > > realize expandos are fine for simple values, but want to know how > > aggressively I should avoid them. > > Don't do either, store data as properties on your plugin instance. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~---
