element.addEvent('blur', this.configureElement.bindWithEvent(this, element); ... configureElement: function(event, element) { alert('the id is' + element.get('id')); }
On Wed, Jan 7, 2009 at 11:28 PM, jiggliemon (via Nabble) < ml-user+114393-900309...@n2.nabble.com<ml-user%2b114393-900309...@n2.nabble.com> > wrote: > > "you could also use bindWithEvent and pass the element as a parameter. > " > > How would this work? > > --------- example? ------- > initialize: function() { > $$(elements).each(function(element){ > element.addEvent('blur', > this.configureElement.bindWithEvent(this)); > }); > }, > configureElement: function(element){ > alert('the id is' + element.get('id')); > } > > > > > > On Jan 7, 11:23 pm, nutron > <anut...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2126733&i=0>> > wrote: > > > you could also use bindWithEvent and pass the element as a parameter. > > > > > > > > On Wed, Jan 7, 2009 at 11:22 PM, Aaron Newton > > <aa...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2126733&i=1>> > wrote: > > > event.target > > > > > On Wed, Jan 7, 2009 at 11:12 PM, jiggliemon (via Nabble) < > > > ml-user+114393-900309...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2126733&i=2> > <ml-user%2b114393-900309...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2126733&i=3>> > > > > > wrote: > > > > >> I'm porting a Magento template over to Mootools, and i've run into a > > >> little issue. > > > > >> Prototype has a ".element()" function where you can select the element > > > >> that an event is attached to. > > > > >> --------- example ------- > > >> initialize: function() { > > >> $$(elements).each(function(element){ > > >> element.addEvent('blur', this.config.bind(this)); > > >> }); > > >> }, > > >> config:function(event){ > > >> //Here's your Prototype function > > >> var element = event.element(); > > >> this.configureElement(element); > > >> }, > > >> configureElement: function(element){ > > >> alert('the id is' + element.get('id')); > > >> } > > > > >> So my question is, how do i select the element of which an event is > > >> bound to in mootools? > > > > >> ------------------------------ > > >> View message @ > > >>http://n2.nabble.com/Porting-Magento-over-to-Mootools-from-Prototype-... > > > >> To start a new topic under MooTools Users, email > > >> ml-node+660466-1583815...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2126733&i=4> > <ml-node%2b660466-1583815...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2126733&i=5>> > > > >> To unsubscribe from MooTools Users, click here< (link removed) >. > > > > ----- > > The MooTools Tutorial: http://www.mootorial.comwww.mootorial.com > > Clientcide: http://www.clientcide.comwww.clientcide.com > > -- > > View this message in context: > http://n2.nabble.com/Porting-Magento-over-to-Mootools-from-Prototype-... > > Sent from the MooTools Users mailing list archive at Nabble.com. > > > ------------------------------ > View message @ > http://n2.nabble.com/Porting-Magento-over-to-Mootools-from-Prototype-tp2126710p2126733.html > To start a new topic under MooTools Users, email > ml-node+660466-1583815...@n2.nabble.com<ml-node%2b660466-1583815...@n2.nabble.com> > To unsubscribe from MooTools Users, click here< (link removed) >. > > > ----- The MooTools Tutorial: http://www.mootorial.com www.mootorial.com Clientcide: http://www.clientcide.com www.clientcide.com -- View this message in context: http://n2.nabble.com/Porting-Magento-over-to-Mootools-from-Prototype-tp2126710p2128884.html Sent from the MooTools Users mailing list archive at Nabble.com.