Question

A couple of weeks ago I was reading through plans for WordPress. One item came to mind today: editable text block.

Thinking of it today, seems to me ExtJS would do the trick.

Have a Div; on click, open some sort of popup containing the text with at least basic edit control (The discussion I'd read was about incorporating some WYSIWYG.) and, of course, function to save the revised Div.

Doable, yes? (I really do need to ask; I dare assume nothing at all.)

--@bentrem aka @ITGeek

p.s. is possible to save both the original and the revised, yes? to leave a History?

Was it helpful?

Solution

Editable block of text on click is available in the Editable Grid. Inline text is replaced with the editable form control.

Outside of grid you would need to wire up your own chain of event and components to accomplish the same. For example you could use a Label component or a Display Field component, add click listener and create a Window component with a textarea (or HTMLEditor) child item and a save button. On save you would run you own logic to copy input value(s) to a model class or send it back to the server via AJAX call. An example of Window popup with multiple components is demonstrated here: http://docs.sencha.com/extjs/4.2.2/#!/example/window/layout.html

Another example of inline editor is shown in this example: http://docs.sencha.com/extjs/4.2.2/#!/example/simple-widgets/editor.html It uses Ext.Editor class to turn a simple label into an editable field.

Yet another way to edit existing data (Form editor on per row basis) http://docs.sencha.com/extjs/4.2.2/#!/example/build/KitchenSink/ext-theme-neptune/#form-grid

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top