On Oct 5, 6:04 pm, Justin Meyer <
justinbme...@gmail.com> wrote:
> Parameterized only happens with the options (2nd param to a controller)
>
> You could so it like:
>
> $.Controller.extend("Foo",{
> defaults: {
> namespace : MyEventClass.Namespace
> }},{
>
> "{namespace}.created subscribe" : function( ..) { ... }
>
> })
>
> Whatever is in MyEventClass.Namespace when the class is created would be
> {namspace} in the action. You could overwrite this when creating controller
> instances:
>
> $('.bar').foo({namespace: "somethingElse"})
>
> Justin Meyer
>
> Jupiter Consulting
> \Development\Training\Support
>
847-924-6039
>
>
>
> On Tue, Oct 5, 2010 at 10:57 AM, PatrickR <
patrick.run...@gmail.com> wrote:
> > Hi,
>
> > I pretty much want to to what is described in this discussion:
>
>
> > i.e. have parametrized event listeners. From the above I gather that
> > this has been tried or maybe even implemented. Is it?
>
> > I've tried something like the following without success:
>
> > $.Controller.extend('Foo',{},
> > {
> > _topics: ['bar','bim'],
> > 'myevent.{_topics[1]}.** subscribe': function(topic, data) {
> > // do stuff
> > }
> > });
>
> > The main reason behind wanting to do this is that I'd like all topics
> > namespaced and available through a separate class. This would makes
> > documentation better and enables tab completion in good IDEs. So my
> > events would actually look like
> > '{MyEventClass.SomeEventTopic}.**': ... Maybe there is a better way to
> > achieve that?
>
> > Thanks,
> > /Patrick
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "JavaScriptMVC" group.
> > To post to this group, send email to
javasc...@googlegroups.com.
> > To unsubscribe from this group, send email to