MooTools Behaviors and Plugins

10 views
Skip to first unread message

daKmoR

unread,
Nov 9, 2011, 12:25:57 PM11/9/11
to Clientcide
I'm not sure howto work with multiple plugins...

say we have an Behavior to add a Datepicker
<input type="text" data-behavior="Datepicker" /> // results in an
english datepicker

now the Datepicker is English by default, so if I want to have a
German Version I will load a Plugin that change all Datepickers to
German
<input type="text" data-behavior="Datepicker" /> // result in an
german datepicker

but doing so I can't open an english and german datepicker on the same
page? unless I create a separate Behavior called GermanDatepicker that
is somewhat a copy of the original version?
is this correct? or am I missing something?

Aaron Newton

unread,
Nov 9, 2011, 12:55:30 PM11/9/11
to clien...@googlegroups.com
in this example, you'd want to change the language using MooTools Locale instead; so the user chooses their language and they get the same date picker language for all of them.

But let's say you wanted to do this anyway. It's important to remember that Behavior is designed for invokation, not for a lot of logic. Filters should mostly find things in the DOM and create instances of classes. So in that case you would have an option for switching between languages that is either passed to the Datepicker class or switches in your Behavior filter between which one it invokes.


--
You received this message because you are subscribed to the Google Groups "Clientcide" group.
To post to this group, send email to clien...@googlegroups.com.
To unsubscribe from this group, send email to clientside+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/clientside?hl=en.


Reply all
Reply to author
Forward
0 new messages