On Saturday, March 1, 2014 10:55:52 AM UTC+1, Dan wrote:
>
> Hi,
>
> I'm creating a Firebug extension and struggling with domplate events.
>
> Given 2 separate elements, each with a separate onclick handler, the same 
> handler (onBtnOneClick) is called for both elements.
>
> Sure, I could check the event.target, but the ui is going to get a lot 
> more complicated than this, and surely I should be able to attach different 
> handlers to different elements?
>
> See the template (some of it) below.
>
> FYI, if I delete btnOne, then onBnTwoClick is called when btnTwo is 
> clicked.
>
> Is this a bug, expected behaviour, or am I doing something else wrong? 
>
> var MyPlate = domplate({
>
>     ui: 
>         TABLE({"class" : "stretch"}, 
>

You are missing TBODY element (Domplate requires that)

Does it help?

Honza


 

>             TR(
>                 TD({"class" : "fit nowrap"},
>                     
>                     A({"class" : "btn flush", "id" : "btnOne", onclick : 
> "$onBtnOneClick"}, 
>                         SPAN({"class" : "icon one"}),
>                         " One"
>                     ),
>
>                     A({"class" : "btn", "id" : "btnTwo", onclick : 
> "$onBtnTwoClick"}, 
>                         SPAN({"class" : "icon select"}),
>                         " Two"
>                     )
>                 ),
>  ......
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Firebug" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/firebug.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/firebug/69d14361-18a3-4b92-901c-5cdd883ef729%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to