behavior.startup can't get it to run anything

16 views
Skip to first unread message

Rolf-nl

unread,
Jul 1, 2013, 3:54:40 PM7/1/13
to clien...@googlegroups.com
I don't know what is wrong with me but I never got this thing to work. I'm probably missing something..


Can someone create a working example? E.g. toggle the element as if I clicked the button.
I have tried every option (jsfiddle is now empty as far as the startup options go)..

?

tia

Aaron Newton

unread,
Jul 1, 2013, 5:50:43 PM7/1/13
to Clientcide
Several issues:

  1. jsfiddle didn't like your js includes from github; they weren't the right mime-type. I don't think it loaded them.
  2. when defining a delegator to trigger on startup, you must define the trigger before you apply behavior, as it's going to attempt to run it immediately.
  3. you have to pass in the getBehavior option for delegator to connect the two; this is not the same thing as passMethods, which allows you to pass methods into the api objects that filters have access to.
  4. when you reference which delegators you wish to trigger on startup (in the data-startup-options) you must use their actual reference names - ToggleElements, not toggleelements.
Working:





--
You received this message because you are subscribed to the Google Groups "Clientcide" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clientside+...@googlegroups.com.
To post to this group, send email to clien...@googlegroups.com.
Visit this group at http://groups.google.com/group/clientside.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Rolf-nl

unread,
Jul 27, 2013, 11:02:23 AM7/27/13
to clien...@googlegroups.com
Sorry for not replying any sooner! I did read it and looked at my own code again. I was doing it all correct, except I wasn't doing behavior.setDelegator(delegator) or applied the behavior too soon.. now I can't remember.

Thanks anyway for summing it up again. Works like a breeze.
Reply all
Reply to author
Forward
0 new messages