0

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?

dbrin
  • 15,525
  • 4
  • 56
  • 83
  • A bit unclear what you are really asking. If you need to see an html editor see this example (Form #3) http://docs.sencha.com/extjs/4.2.2/#!/example/form/dynamic.html – dbrin Dec 18 '13 at 05:05
  • Accepting HTML would be secondary, as would WYSIWYG of any sort. As I wrote: basic editing. text revision. On https://twitter.com/dmitrybrin click Edit Profile. HeyPresto. But say: what bit is unclear? – Bernard ''ben'' Tremblay Dec 18 '13 at 05:12

1 Answers1

1

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

dbrin
  • 15,525
  • 4
  • 56
  • 83
  • Fabulous Dmirty; thanks muchly. I'm familiar with / have used Sencha Popups; what concerns me most is the ability to Save the revised contents. p.s. was just looking at http://livedocs.dojotoolkit.org/dijit/InlineEditBox – Bernard ''ben'' Tremblay Dec 19 '13 at 15:00
  • Thanks for accepting. These frameworks are vastly different and won't always matchup to each other on the out of box components and functionality. However with enough skill and help you can do pretty much anything in either. – dbrin Dec 19 '13 at 18:34