Hi!

I have been trying to build some widgets for my webapp.
Before I had read this blog post
http://mootools.net/blog/2010/06/10/setting-up-elements/
I was augmenting my elements in the following way:

var myForm = new Element('form');
myForm.fields = {
    firstName: new Element('input', {
            'type': 'text',
            'name': 'firstName',
            'id': 'firstName'
        }),
    /* other fields */
}
myForm.setLabel = function(label, fieldName) {
    /* function body */
};

Now according to the blog post I should augment my elements in a different way:
myForm.store('setLabel',  function(label, fieldName) {
    /* function body */
});
And call the function as:
myForm.retrieve('setLabel')('First name:', 'firstName');

Do I correctly understand the blog post? If so, it is quite unusual
for me to call my helper methods in this way.
Thanks in advance.

-- 
with regards,
Maxim

Reply via email to