PDA

View Full Version : onClick to text field?



LALING
2 Nov 2007, 11:00 AM
Is there a way or extension to use that you can click a link and change the desired text into a text field?

2 Nov 2007, 11:03 AM
yes, basically you add click a listener, then assign a handler that changes the the div to a text field.

aconran
2 Nov 2007, 11:18 AM
There is a class designed for this called Ext.Editor (http://extjs.com/deploy/ext/docs/output/Ext.Editor.html).

To use it:
First create a form field relevant to your content like a Ext.form.TextArea
Bind the form field to the editor by passing it in to the first argument of the constructor
Then you can call the editors startEdit method on the element (div) which you'd like to edit.

LALING
2 Nov 2007, 12:07 PM
thanks acon and liquid. Ill check it out. I'f i run into problems or questions, ill be back.

LALING
2 Nov 2007, 10:57 PM
Can you show an example? I seriously don't know where/how to start. I've read the tuts and docs but I still don't get it. I think it's because I'm so new to it all.

LALING
5 Nov 2007, 9:46 PM
Anyone have an idea to do this? The extjs documentation is not really helpful to newbies like me.

fay
6 Nov 2007, 2:39 AM
http://extjs.com/learn/Extension:InlineFormFields

LALING
6 Nov 2007, 9:39 AM
Yeah that's what I'm using right now, it's just a textfield with css that hides the border and background of the field. I don't reallt like it. I'm looking more into in-place editing, but without grids.

aconran
6 Nov 2007, 9:45 AM
That's a nice extension that I had not seen yet. I will try to put together an example for you of using the Editor sometime this week but the end result is not going to be that much different than the user extension.