Tobias Haagen Michaelsen
2007-May-10 11:12 UTC
SV: [Rails-spinoffs] Builder.node (script.aculo.us)
That is because you need to build the anchor node as well, instead of passing it
as the textual value. You should also take advantage of the possibility to nest
child nodes:
var newRow = Builder.node(''tr'', [
Builder.node(''td'', staffname),
Builder.node(''td'', [ Builder.node(''a'',
{href: ''#''}, ''list'') ])
]);
-Tobias
-----Oprindelig meddelelse-----
Fra: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
[mailto:rubyonrails-spinoffs@googlegroups.com] På vegne af Yuan Yudistira
Sendt: 10. maj 2007 12:38
Til: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Emne: [Rails-spinoffs] Builder.node (script.aculo.us)
Hello guys,
I need some help ... :-)
I try to use Builder.node, (add new row)
But I need to add HTML tag on node td2
But what I get using below code is
text ''<a href=#>list</a> , instead of link
Please help ...
Thanks
YUAN
function submitAddNewStaffForm()
{
var notice = $(''contentDiv'');
var form = $(''newStaffForm'');
var staffName = $F(''formName'');
form.request();
form.request({
onLoading: notice.update("saving data .. ..."),
onComplete: function(transport){
notice.update("Form data saved...");
var newID = transport.responseText;
newRow = Builder.node(''tr'');
td1 = Builder.node(''td'',staffName);
td2 = Builder.node(''td'',''<a
href=#>list</a>'');
newRow.appendChild(td1);
newRow.appendChild(td2);
$(''listStaff'').appendChild(newRow);
}
})
}
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Limitless undying love
which shines around me like a million suns
It calls me on and on across the universe...."
Accross The Universe - The Beatles -
--------------------------------------------
Visit :
http://www.sabukhitam.com/
=====================
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Yuan Yudistira
2007-May-10 12:38 UTC
Re: SV: [Rails-spinoffs] Builder.node (script.aculo.us)
Hi
I tried :
newRow = Builder.node(''tr'');
td1 = Builder.node(''td'',staffName);
td2 = Builder.node(''td'',
[Builder.node(''a'', {href: ''#''},
''link'')]);
newRow.appendChild(td1);
newRow.appendChild(td2);
it works.
But :
var newRow = Builder.node(''tr'', [
Builder.node(''td'', staffname),
Builder.node(''td'', [ Builder.node(''a'',
{href: ''#''}, ''list'') ])
]);
it doesn''t work. Just nothing happens. and there is no error on
FireBug. just nothing happens.
Why is that?
Thanks
YUAN
On 5/10/07, Tobias Haagen Michaelsen
<thm-GhZjJAf4V71knbxzx/v8hQ@public.gmane.org>
wrote:>
> That is because you need to build the anchor node as well, instead of
passing it as the textual value. You should also take advantage of the
possibility to nest child nodes:
>
> var newRow = Builder.node(''tr'', [
> Builder.node(''td'', staffname),
> Builder.node(''td'', [
Builder.node(''a'', {href: ''#''},
''list'') ])
> ]);
>
>
> -Tobias
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Limitless undying love
which shines around me like a million suns
It calls me on and on across the universe...."
Accross The Universe - The Beatles -
--------------------------------------------
Visit :
http://www.sabukhitam.com/
=====================
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---