Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#4098 closed defect (fixed)

InlineEditBox: change API to have one widget and defer creation of edit widget

Reported by: bill Owned by: bill
Priority: high Milestone: 1.0
Component: Dijit Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

InlineEditBox? currently works by specifying a nested edit widget:

<div dojoType=dijit.form.InlineEditBox>
   <input dojoType=dijit.form.ValidationTextBox value="3">
</div>

This has two disadvantages:

  1. Tedious to create such a widget in markup or programmatically (since there are two widgets involved)
  2. Performance issues since the editor widget is created on page load rather than on the fly (when you click to edit). This prevents InlineEditBox? from being used for table cells or tree cells (or any place there would be hundreds of said InlineEditBox? widgets).

Make this work like 0.4 where there's just a single widget:

<div dojoType=InlineEditBox> hello world </div>

and if you need a custom editor then specify it as a parameter

<div dojoType=InlineEditBox editor=dijit.form.NumberTextBox
editorParams="{required: true}">
3
</div>

Note that the developer is responsible for inserting the localized value into the markup (in the cases where the canonical value is different than the localized value), and then the edit widget needs an interface to be initialized from a localized value.

See related bug #4097. Fixing this will fix that bug too.

Change History (18)

comment:1 Changed 12 years ago by bill

Owner: changed from haysmark to Douglas Hays

comment:2 Changed 12 years ago by bill

(In [10354]) Better testcase for how I want InlineEditBox? to work.

  • shows how you should specify a width for inline elements similar to the way

you specify the width of an <input>... ie, a width that is unrelated to the width of the current value.

  • Also gives much better test of inherited styles from <style> tags and from the

browser's builtin rules for <p>, <h3>, etc. (All such style info must appear in the non-editing version of the text and the edit version of the tet.)

  • Also demonstrates a problem with specifying paragraphs of text, inserting

unwanted line breaks (see #4098 for possible solution).

Refs #4097, #4098, #4167.

comment:3 Changed 12 years ago by bill

Description: modified (diff)
Summary: InlineEditBox: investigate changing API to have one widget and defer creation of edit widgetInlineEditBox: change API to have one widget and defer creation of edit widget

comment:4 Changed 12 years ago by Douglas Hays

Owner: changed from Douglas Hays to bill

InlineEditBox? being redesigned by bill

comment:5 Changed 12 years ago by bill

(In [10631]) Start refactor of InlineEditBox? to keep original srcNode, and create edit widget on demand. Code not working (well) yet. Refs #4097, #4098.

comment:6 Changed 12 years ago by bill

(In [10824]) Continue InlineEditBox? work. Since we can't compute the width of a <span> on IE, since it's display:inline, I had to put a width="..." parameter for the widget. Refs #4097, #4098.

comment:7 Changed 12 years ago by bill

(In [10893]) First pass at getting save & cancel buttons working. Refs #4097, #4098.

comment:8 Changed 12 years ago by bill

(In [10918]) Avoid screen jitter when switching from display mode to editor. Refs #4097, #4098.

comment:9 Changed 12 years ago by bill

(In [10919]) Fix inline mode (ie, editors for numbers, etc. that are inline with a line of text). Refs #4097, #4098.

comment:10 Changed 12 years ago by bill

Resolution: fixed
Status: newclosed

(In [10920]) Make no-value indicator work, and let user specify arbitrary HTML to use when no value is specified. Fixes #4362. Also, due to this and all the previous checkins, fixes #4097, #4098.

comment:11 Changed 12 years ago by bill

(In [10921]) Start to get keyboard support working again (but still broken on IE). Refs #4098.

comment:12 Changed 12 years ago by bill

(In [10929]) Test case improvements (refs #4098). This exposes a number of bugs that I need to fix.

comment:13 Changed 12 years ago by bill

(In [10935]) Select all text on start of edit, which fixes IE problem of no cursor in input box. Refs #4098.

comment:14 Changed 12 years ago by bill

(In [10937]) Various InlineEditBox? fixes. Refs #4098.

comment:15 Changed 12 years ago by bill

(In [10969]) Deprecate dijit.form.InlineEditBox? and switch existing tests to use dijit.InlineEditBox?. Refs #4098

comment:16 Changed 12 years ago by bill

(In [11798]) Remove deprecated dijit.form.InlineEditBox? code (deprecated in 1.0 release, in favor of dijit.InlineEditBox?, for removal in 1.1.) Refs #4098.

comment:17 Changed 12 years ago by Adam Peller

(In [12544]) Fix typo. Refs #4098

comment:18 Changed 11 years ago by bill

(In [14763]) Remove unused file (as of [11798]). Refs #4098.

Note: See TracTickets for help on using tickets.