How would you translate to amber the following JavaScript declaration:
searchoptions:{dataInit:function(el) {$(el).datepicker({dateFormat: "yy-mm-dd"});} } I would think something like that: #{'searchoptions' -> #{'dataInit' -> block}} Can't get the block working. My best bet was: 'searchoptions' -> #{'dataInit' -> [ :el | el datepicker: #{'dateFormat' -> 'yy-mm-dd'} ]} I am getting though an error: [object HTMLInputElement] does not understand #datepicker: #{'searchoptions' -> #{'dataInit' -> [ :el | console log: el ]} } displays in the console an input element. Thanks in advance. |
laci wrote: > How would you translate to amber the following JavaScript declaration: > > searchoptions:{dataInit:function(el) {$(el).datepicker({dateFormat: > "yy-mm-dd"});} } > > I would think something like that: > #{'searchoptions' -> #{'dataInit' -> block}} > > Can't get the block working. > > My best bet was: > 'searchoptions' -> #{'dataInit' -> [ :el | el datepicker: > #{'dateFormat' -> > 'yy-mm-dd'} ]} The rest seems to be right. Herby -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
Tried that too but got similar error message:
[object HTMLInputElement] does not understand #asJQuery I will check with the latest master code. |
On recent amber version I tried and it worked calling : JSObjectProxy>>asJQuery <return jQuery(self['@jsObject'])>
2013/6/25 laci <[hidden email]> Tried that too but got similar error message: Clément Béra Mate Virtual Machine Engineer Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
Works fine with the latest master build. Thanks for the replies.
|
In reply to this post by Clément Béra
what about (untested):
asJQuery ^ window jQuery: jsObject Cheers, Nico On Jun 25, 2013, at 9:25 AM, Clément Bera <[hidden email]> wrote:
-- Nicolas Petton http://www.nicolas-petton.fr You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
I do not like explicit window much... I like
asJQuery ^ jQuery value: jsObject more. (and there is more of this - I mean smalltalkizable js methods). Herby Nicolas Petton wrote: > what about (untested): > > asJQuery > ^ window jQuery: jsObject > > > Cheers, > Nico > > On Jun 25, 2013, at 9:25 AM, Clément Bera <[hidden email] > <mailto:[hidden email]>> wrote: > >> On recent amber version I tried and it worked calling : >> >> JSObjectProxy>>asJQuery >> <return jQuery(self['@jsObject'])> -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
I agree, I like it this way too.
Nico On Jun 26, 2013, at 9:32 PM, Herby Vojčík <[hidden email]> wrote: > I do not like explicit window much... I like > > asJQuery > ^ jQuery value: jsObject > > more. > (and there is more of this - I mean smalltalkizable js methods). > > Herby > > Nicolas Petton wrote: >> what about (untested): >> >> asJQuery >> ^ window jQuery: jsObject >> >> >> Cheers, >> Nico >> >> On Jun 25, 2013, at 9:25 AM, Clément Bera <[hidden email] <mailto:[hidden email]>> wrote: >> >>> On recent amber version I tried and it worked calling : >>> >>> JSObjectProxy>>asJQuery >>> <return jQuery(self['@jsObject'])> > > -- > You received this message because you are subscribed to the Google Groups "amber-lang" group. > To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. > For more options, visit https://groups.google.com/groups/opt_out. > > -- Nicolas Petton http://www.nicolas-petton.fr -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/groups/opt_out. |
Free forum by Nabble | Edit this page |