this.render fails with error

3 views
Skip to first unread message

Mark

unread,
Dec 20, 2009, 4:05:16 AM12/20/09
to JavaScriptMVC
Hi there,

I think i have my syntax on render wrong as it fails. I am migrating
from v1 to v2..

This is inside controller

this.render({ view: "views/calendar/calendar", html: "#calendar-
layer" })

and it fails with Error: Object doesn't support this property or
method

so i tried the jquery way and it works.. what am i doing wrong..

$("#calendar-layer").html('views/calendar/calendar', { data: {} });

I would appreciate any info anybody has...

I think i have the syntax correct ...

Alexandre Gomes

unread,
Dec 20, 2009, 6:30:11 AM12/20/09
to javascriptmvc
   You can do this,

     $("#calendar-layer").html( this.view('calendar/calendar', { data: {} }) );


   You can also try this if you want to reference an element that is a child of the controller element (useful if you're using the class attribute to tag the element):

   this.find("#calendar-layer").html( this.view('calendar/calendar', { data: {} }) );






--

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 javascriptmv...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javascriptmvc?hl=en.



Mark

unread,
Dec 20, 2009, 8:09:45 AM12/20/09
to JavaScriptMVC
Hi Alexandre,

thank you... yes my jquery works without an issue but according to the
documentation i am supposed to be able to do the following and its the
recommended way of rendering but it fails with the errorr

this.render({ view: "views/calendar/calendar", html: "#calendar-
layer" })

On Dec 20, 12:30 pm, Alexandre Gomes <alexandre.r...@gmail.com> wrote:
>    You can do this,
>
>      $("#calendar-layer").html( this.view('calendar/calendar', { data: {} })
> );
>
>    You can also try this if you want to reference an element that is a child
> of the controller element (useful if you're using the class attribute to tag
> the element):
>
>    this.find("#calendar-layer").html( this.view('calendar/calendar', { data:
> {} }) );
>

> On Sun, Dec 20, 2009 at 9:05 AM, Mark <smit...@live.com> wrote:
> > Hi there,
>
> > I think i have my syntax on render wrong as it fails. I am migrating
> > from v1 to v2..
>
> > This is inside  controller
>
> >    this.render({ view: "views/calendar/calendar", html: "#calendar-
> > layer" })
>
> > and it fails with Error: Object doesn't support this property or
> > method
>
> > so i tried the jquery way and it works.. what am i doing wrong..
>
> > $("#calendar-layer").html('views/calendar/calendar', { data: {} });
>
> > I would appreciate any info anybody has...
>
> > I think i have the syntax correct ...
>
> > --
>
> > 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

> > javascriptmv...@googlegroups.com<javascriptmvc%2Bunsu...@googlegroups.com>

Justin Meyer

unread,
Dec 20, 2009, 12:07:06 PM12/20/09
to javasc...@googlegroups.com
the docs are wrong.  We do accept documentation patches.  
Justin Meyer

Jupiter Consulting
\Development\Training\Support
847-924-6039
justin...@gmail.com


To unsubscribe from this group, send email to javascriptmv...@googlegroups.com.

Mark

unread,
Dec 20, 2009, 12:17:26 PM12/20/09
to JavaScriptMVC
Hi Justin, so what is the correct syntax ???

or do you advise i use the jquery way now?

i have this

this.render({ view: "views/calendar/calendar", html: "#calendar-
layer" })

On Dec 20, 6:07 pm, Justin Meyer <justinbme...@gmail.com> wrote:
> the docs are wrong.  We do accept documentation patches.
> Justin Meyer
>
> Jupiter Consulting
> \Development\Training\Support847-924-6039

> justinbme...@gmail.com

> > <javascriptmvc%2Bunsu...@googlegroups.com<javascriptmvc%252Buns...@googlegroups.com>

Justin Meyer

unread,
Dec 20, 2009, 12:32:52 PM12/20/09
to javasc...@googlegroups.com
Alex's syntax was right.

Justin Meyer

Jupiter Consulting
\Development\Training\Support
847-924-6039
To unsubscribe from this group, send email to javascriptmv...@googlegroups.com.

Mark

unread,
Dec 20, 2009, 12:50:16 PM12/20/09
to JavaScriptMVC
Great! thanks..

so its using the jquery version, great i am ok with that.. i actually
prefer it...

On Dec 20, 6:32 pm, Justin Meyer <justinbme...@gmail.com> wrote:
> Alex's syntax was right.
>
> Justin Meyer
>
> Jupiter Consulting

> \Development\Training\Support847-924-6039
> justinbme...@gmail.com

> > > > <javascriptmvc%2Bunsu...@googlegroups.com<javascriptmvc%252Buns...@googlegroups.com>
> > <javascriptmvc%252Buns...@googlegroups.com<javascriptmvc%25252Bun...@googlegroups.com>

Reply all
Reply to author
Forward
0 new messages