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)
The roles are for ARIA.
> 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
-~----------~----~----~----~------~----~------~--~---