Hello all,
I am simply trying to insert a row between two rows and I am not able.
If I use the following code, I can append a row to the table. However,
it''s not what I want to achieve.
$(''myTable'').insert(new
Template(''<tr><td>#{name}</td></tr>'')
.evaluate({
name: ''ABC'',
}));
I tried
$(''myRow1'').insert(new
Template(''<tr><td>#{name}</td></tr>'')
.evaluate({
name: ''ABC'',
}));
and it doesn''t work. Anybody has an idea?
Thank you!
Martin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Using 1.6+ you could try something like:
$(''myRow1'').insert({
after:
''<tr><td>#{name}</td></tr>''.interpolate({
name: ''ABC''
})
})
http://www.prototypejs.org/api/element/insert
http://www.prototypejs.org/api/string/interpolate
- kangax
On Mar 1, 3:30 pm, Martin
<martinga...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hello all,
>
> I am simply trying to insert a row between two rows and I am not able.
> If I use the following code, I can append a row to the table. However,
> it''s not what I want to achieve.
> $(''myTable'').insert(new
Template(''<tr><td>#{name}</td></tr>'')
> .evaluate({
> name: ''ABC'',
> }));
>
> I tried
>
> $(''myRow1'').insert(new
Template(''<tr><td>#{name}</td></tr>'')
> .evaluate({
> name: ''ABC'',
> }));
>
> and it doesn''t work. Anybody has an idea?
>
> Thank you!
>
> Martin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
It''s exactly what I am doing :
$(''myRow1'').insert(new
Template(''<tr><td>#{name}</td></tr>'')
.evaluate({
name: ''ABC'',
}));
No? And it doens''t work. :(
On Mar 1, 12:49 pm, kangax
<kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Using 1.6+ you could try something like:
>
> $(''myRow1'').insert({
> after:
''<tr><td>#{name}</td></tr>''.interpolate({
> name: ''ABC''
> })
>
> })
>
>
http://www.prototypejs.org/api/element/inserthttp://www.prototypejs.org/api/string/interpolate
>
> - kangax
>
> On Mar 1, 3:30 pm, Martin
<martinga...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > Hello all,
>
> > I am simply trying to insert a row between two rows and I am not able.
> > If I use the following code, I can append a row to the table. However,
> > it''s not what I want to achieve.
> > $(''myTable'').insert(new
Template(''<tr><td>#{name}</td></tr>'')
> > .evaluate({
> > name: ''ABC'',
> > }));
>
> > I tried
>
> > $(''myRow1'').insert(new
Template(''<tr><td>#{name}</td></tr>'')
> > .evaluate({
> > name: ''ABC'',
> > }));
>
> > and it doesn''t work. Anybody has an idea?
>
> > Thank you!
>
> > Martin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Notice the "after" property name! On Mar 1, 10:03 pm, Martin <martinga...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> It''s exactly what I am doing : > > $(''myRow1'').insert(new Template(''<tr><td>#{name}</td></tr>'') > .evaluate({ > name: ''ABC'', > })); > > No? And it doens''t work. :( > > On Mar 1, 12:49 pm, kangax <kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Using 1.6+ you could try something like: > > > $(''myRow1'').insert({ > > after: ''<tr><td>#{name}</td></tr>''.interpolate({ > > name: ''ABC'' > > }) > > > }) > > >http://www.prototypejs.org/api/element/inserthttp://www.prototypejs.o... > > > - kangax > > > On Mar 1, 3:30 pm, Martin <martinga...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hello all, > > > > I am simply trying to insert a row between two rows and I am not able. > > > If I use the following code, I can append a row to the table. However, > > > it''s not what I want to achieve. > > > $(''myTable'').insert(new Template(''<tr><td>#{name}</td></tr>'') > > > .evaluate({ > > > name: ''ABC'', > > > })); > > > > I tried > > > > $(''myRow1'').insert(new Template(''<tr><td>#{name}</td></tr>'') > > > .evaluate({ > > > name: ''ABC'', > > > })); > > > > and it doesn''t work. Anybody has an idea? > > > > Thank you! > > > > Martin--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Not really.
You''re trying to insert "into" not "after"
insert({ after: ... })
On Mar 1, 4:03 pm, Martin
<martinga...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> It''s exactly what I am doing :
>
> $(''myRow1'').insert(new
Template(''<tr><td>#{name}</td></tr>'')
> .evaluate({
> name: ''ABC'',
> }));
>
> No? And it doens''t work. :(
>
> On Mar 1, 12:49 pm, kangax
<kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > Using 1.6+ you could try something like:
>
> > $(''myRow1'').insert({
> > after:
''<tr><td>#{name}</td></tr>''.interpolate({
> > name: ''ABC''
> > })
>
> > })
>
>
>http://www.prototypejs.org/api/element/inserthttp://www.prototypejs.o...
>
> > - kangax
>
> > On Mar 1, 3:30 pm, Martin
<martinga...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > Hello all,
>
> > > I am simply trying to insert a row between two rows and I am not
able.
> > > If I use the following code, I can append a row to the table.
However,
> > > it''s not what I want to achieve.
> > > $(''myTable'').insert(new
Template(''<tr><td>#{name}</td></tr>'')
> > > .evaluate({
> > > name: ''ABC'',
> > > }));
>
> > > I tried
>
> > > $(''myRow1'').insert(new
Template(''<tr><td>#{name}</td></tr>'')
> > > .evaluate({
> > > name: ''ABC'',
> > > }));
>
> > > and it doesn''t work. Anybody has an idea?
>
> > > Thank you!
>
> > > Martin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Thank you! :D It works! On Mar 1, 1:09 pm, kangax <kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Not really. > You''re trying to insert "into" not "after" > > insert({ after: ... }) > > On Mar 1, 4:03 pm, Martin <martinga...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > It''s exactly what I am doing : > > > $(''myRow1'').insert(new Template(''<tr><td>#{name}</td></tr>'') > > .evaluate({ > > name: ''ABC'', > > })); > > > No? And it doens''t work. :( > > > On Mar 1, 12:49 pm, kangax <kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Using 1.6+ you could try something like: > > > > $(''myRow1'').insert({ > > > after: ''<tr><td>#{name}</td></tr>''.interpolate({ > > > name: ''ABC'' > > > }) > > > > }) > > > >http://www.prototypejs.org/api/element/inserthttp://www.prototypejs.o... > > > > - kangax > > > > On Mar 1, 3:30 pm, Martin <martinga...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hello all, > > > > > I am simply trying to insert a row between two rows and I am not able. > > > > If I use the following code, I can append a row to the table. However, > > > > it''s not what I want to achieve. > > > > $(''myTable'').insert(new Template(''<tr><td>#{name}</td></tr>'') > > > > .evaluate({ > > > > name: ''ABC'', > > > > })); > > > > > I tried > > > > > $(''myRow1'').insert(new Template(''<tr><td>#{name}</td></tr>'') > > > > .evaluate({ > > > > name: ''ABC'', > > > > })); > > > > > and it doesn''t work. Anybody has an idea? > > > > > Thank you! > > > > > Martin--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---