Hi all,
I have been interested in Ajax.InPlaceCollectionEditor provided by
scriptaculous and have been trying to implement an ajax based dropdown
other then the default implementation where we hardcode the values
like "collection:
["one","two","three","four","five"]"
(provide a
hardcode string array).
I have implemented this in DWR and java but the problem here is with
the javascript.
with this
longstr =
"[''"+data[3]+"'',''"+data[4]+"'']"
alert("in the function "+longstr);
I am getting the ajax responses correctly. I need to correctly assign
it to (collection: longstr;) to dynamically populate the dropdown with
ajax response .
THE HARDCODED WAY ....collection:
["one","two","three","four","five"]
is working fine for me
I have added the code here. Any help or tip is highly appreciated.
thnx
Sanath
<code>
var longstr = "";
UserManager.getCounties(callbackfunc);
function callbackfunc(data){
longstr =
"[''"+data[3]+"'',''"+data[4]+"'']"
alert("in the function "+longstr);
return longstr ;
}
new
Ajax.InPlaceCollectionEditor(editable1[j].id,''users.html?id=''
+
userId,
{
//collection:
["one","two","three","four","five"]
collection: longstr;
}
);
</code>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
san a écrit :> Hi all, > I have been interested in Ajax.InPlaceCollectionEditor provided by > scriptaculous and have been trying to implement an ajax based dropdown > other then the default implementation where we hardcode the values > like "collection: ["one","two","three","four","five"]" (provide a > hardcode string array).Er, nope. The default implementation has options that let you load the collection through Ajax (loadCollectionURL is the main one). http://mir.aculo.us/2007/7/17/in-place-editing-the-summer-2007-rewrite Perhaps you''re using an old version of script.aculo.us? -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
hi Christophe,
Thnx for the prompt response.
I am bit new to scriptaculous and very much keen to learn it.
I have found this post usefull -
http://www.mail-archive.com/rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org/msg12182.html
My problem is this.
UserManager.getCounties(callbackfunc);
function callbackfunc(data){
return data;
}
I am getting the ajax response in my callbackfunc() here. I need to
get it inside the inpalcecollectioneditor collection attribute.
new
Ajax.InPlaceCollectionEditor(editable1[j].id,''users.html?id=''
+
userId,
{
collection:
#######################;
}
);
How can I achieve this. Pls give some advice.
How can I use "loadCollectionURL " as u mentioned to get this done.
thnx
sanath
On Feb 28, 8:11 pm, Christophe Porteneuve
<t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org>
wrote:> san a écrit :
>
> > Hi all,
> > I have been interested in Ajax.InPlaceCollectionEditor provided by
> > scriptaculous and have been trying to implement an ajax based dropdown
> > other then the default implementation where we hardcode the values
> > like "collection:
["one","two","three","four","five"]"
(provide a
> > hardcode string array).
>
> Er, nope. The default implementation has options that let you load the
> collection through Ajax (loadCollectionURL is the main one).
>
> http://mir.aculo.us/2007/7/17/in-place-editing-the-summer-2007-rewrite
>
> Perhaps you''re using an old version of script.aculo.us?
>
> --
> Christophe Porteneuve aka TDD
> t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---