You can do all that very easy with prototype and script.aculo.us. I have answered one by one within quote.
On 6/25/06,
Dark Ambient <[EMAIL PROTECTED]> wrote:
You don't have to worry about X/Y. Scriptaculous dragdrop.js handles all that. The actually "targeting" is performed by the elements (div). There is no limit in depth, layout or anything else.
See "Sortable.create", and "Draggable" aswell "Droppable" in the wiki (aka documentation tab on the website)
You should check out the "onDrop" option. Combine this with either a "Ajax.Updater" or have a look at the "Builder" class. onDrop allows you to call various functions basicly allowing you to do anything you want.. change colors, do effects, create new elements, get content via ajax, etc. etc..
Formdata: prototype offers an easy function to do this: $F('theTextfieldId') .. returns the entered text. If you want to read the content of a div then use $('theDivId').innerHTML .. there is always something available in prototype to get the job done. I love it.
3- Last tricky thing is I'd like a way to replenish the palette, so
I don't understand what a pallete is. Neither what replenish means (i'm german, pardon), but about the reappearing i can tell that this is quiet easy too.
I forgot the name, but there is a option for this within the "Draggable" class .. if the draggable option is set to true the textfield will work as "pile" wherefrom users can drag unlimited textfields from (or whatever you set as draggable). If they drop the current object on a defined 'droppable' the "onDrop" event is your friend to work further with this new type of user input (as described above)
Regards, Kjell
I apologize if these questions are not relevant to Scriptaculous. I
just want to get a general idea if I can acomplish some or all of
these things with the framework, and then what (if any) I'll need to
do outside just using _javascript_.
For now, I have 2 column layout. On the right I want a form palette
where form elements can be dragged to the left column. I have a form
inside the left column div.
1- I need to have the elements in the palette snap to a "grid"inside
of it. Same thing when it gets dropped into the form. I guess it
would be tricky not having specific x/y points because there is no
specific place in the form where elements must go or how they would be
layout out.
You don't have to worry about X/Y. Scriptaculous dragdrop.js handles all that. The actually "targeting" is performed by the elements (div). There is no limit in depth, layout or anything else.
2- Once the form is created, user fills in the info, hits the submit
button, I will have an additonal div where I want to display the post
form data. Anything within prototype to help facilitate ?
You should check out the "onDrop" option. Combine this with either a "Ajax.Updater" or have a look at the "Builder" class. onDrop allows you to call various functions basicly allowing you to do anything you want.. change colors, do effects, create new elements, get content via ajax, etc. etc..
Formdata: prototype offers an easy function to do this: $F('theTextfieldId') .. returns the entered text. If you want to read the content of a div then use $('theDivId').innerHTML .. there is always something available in prototype to get the job done. I love it.
when a text field gets used another would appear.
I don't understand what a pallete is. Neither what replenish means (i'm german, pardon), but about the reappearing i can tell that this is quiet easy too.
I forgot the name, but there is a option for this within the "Draggable" class .. if the draggable option is set to true the textfield will work as "pile" wherefrom users can drag unlimited textfields from (or whatever you set as draggable). If they drop the current object on a defined 'droppable' the "onDrop" event is your friend to work further with this new type of user input (as described above)
Regards, Kjell
My apologies if this goes beyond the subject matter for the list.
Any pointers / links, would be greatly appreciated.
TIA
Stuart
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________ Rails-spinoffs mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
