Sorry, I get paid to write code, not to document it. I can paste what
I'm using though:

new Ajax.InPlaceCollectionEditor(el, "___relations.saveRelation.ajax", {
        okText:"Save",
        cancelText:"Cancel",
        externalControl:control,
        externalControlOnly:true,
        loadOptionsURL:"___relation.getOptions"+relationid+".ajax"
});

My version works almost exactly the same as InPlaceEditor. I couldn't be
arsed to work out how to use it as intended - I think you set an array
as one of the options. It was pretty obvious to me that it wasn't going
to pull in the options externally so I wrote this patch to correct that.
It seems like loadTextURL option is used to load the default value from
the collection. Doesn't make a lot of sense to me.

PS. externalControlOnly is an option I submitted a patch for a long time
ago. It allows you to active and InPlaceEditor (and transparently, this
collections thing too), by only clicking the externalControl (ie. not by
clicking the element itself, which isn't very intuitive).

-Rob

[EMAIL PROTECTED] wrote:
> Hi,
> 
>>Attached is a patch to allow Ajax.InPlaceCollectionEditor to load the
>>collection using AJAX.
>>
>>It adds a new option, loadOptionsURL, which is the URL used to load the
>>values over the interweb. It expects the server to return
>><option></option> values. If one of them has a selected="selected"
>>attribute, it will probably be pre-selected. Not tested that though.
>>
>>Also only tested in FF, however the only actual new code is a line of
>>Element.update(), so I don't foresee any X-Browser problems.
>>
>>As usual, development site, can't show the example to the world.
>>
>>Yet another patch that will never know what CVS is. Enjoy people.
> 
> 
> can you can send an example on like using this function?  On the wiki
> there isn't code about InPlaceCollectionEditor
> 
> Antonello
> 
>>-Rob
>>_______________________________________________
>>Rails-spinoffs mailing list
>>Rails-spinoffs@lists.rubyonrails.org
>>http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>>
> 
> 
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to