So when you say extend this means I don't need to alter the source in the controls.js right?
How do you go about defining an element that is editable with your code, with scriptaculous they obviously use
new Ajax.InPlaceEditor(element, 'url', [options]);
What techniques would you use if you wanted to update a value in a table based on the value that has been entered in the editor?
Is it the use of Observers or should I simply use a callback that includes a function, e.g.
new Ajax.InPlaceEditor( 'label_' + questionID, 'URL', {callback:function (form, value){ $('element).setAttribute("aLabel", value); return 'value=' + value; }});
Sorry for these questions but just starting out with JS and pretty impressed with things so far...have you tried the Yahoo YUI? I think the design patterns look smart, would be even better if they had more examples on how to implement these things :)
On 5/24/06, Eric Anderson <[EMAIL PROTECTED]> wrote:
Carlton Dickson wrote:
> I was wondering if anyone has implemented the inplace editor without the
> need for the URL. I have tried this but run into a problem in that the
> 'saving...' text in shown for ever and the label is no longer editable.
Yes, I have a project I worked on to try to create a editable tree (for
a manual) at:
http://docdemo.cordata.com/
The goal was to provide a editable tree by using drag-n-drop and the
in-place editor. Feel free to play around with this demo. It refreshes
itself every day. To edit do the following:
1) Expand the TOC by clicking on the TOC pop out.
2) Hit the edit button to put the tree in edit mode.
3) Start editing.
You can click the "pencil/paper" icon to edit the text of a node. Drag
an node to the trash can to remove it (just hit enter on the popup to
avoid the annoying drag mess). Drag the folder on the tree to add a
folder. Drag the header of any page onto the tree to add a new link.
But the important part you are looking for can be found in this file:
http://docdemo.cordata.com/_javascript_/jstree.js
At the very end you will see I extend the in-place editor to allow
callbacks to be defined instead of a URL. The old Ajax interface still
works as well.
Eric
_______________________________________________
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
