Opened 11 years ago

Closed 11 years ago

#6668 closed enhancement (fixed)

destroy() option to not remove dom node

Reported by: bill Owned by: dante
Priority: high Milestone: 1.2
Component: Dijit Version: 1.1.0
Keywords: Cc:
Blocked By: Blocking:

Description

Keep Widget.destroy() working the same as today, where it destroys _Widget.domNode, but add parameter to destroy() such that _Widget.destroy(true) does:

  • for behavioral widgets it leaves the original dom node in place, just removing the behavior
  • eventually (not for milestone 1.2) for templated widgets, it will revert the widget to it's original source dom node. In the case of form widgets, the original dom node is an <input>, and the form widget's value should be written to that input, so that form submit works as if the widget still existed. This will hopefully make the back/forward button not erase or "misalign" the values the user previously input into the form. (Have to be a bit careful w/this one though because currently for performance reasons we destroy the original dom node)

This requires removing the finalize parameter from destroy(), but it's unused anyway so that shouldn't be an issue.

Attachments (3)

_Widget.patch (2.2 KB) - added by dante 11 years ago.
testFisheye.html (3.4 KB) - added by dante 11 years ago.
example destroy() / re-init
destroy.patch (6.7 KB) - added by dante 11 years ago.
updated patch / docs / testcase. could be unit test, etc.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 11 years ago by dante

Status: newassigned

comment:2 Changed 11 years ago by dante

originates at #5684

Changed 11 years ago by dante

Attachment: _Widget.patch added

Changed 11 years ago by dante

Attachment: testFisheye.html added

example destroy() / re-init

Changed 11 years ago by dante

Attachment: destroy.patch added

updated patch / docs / testcase. could be unit test, etc.

comment:3 Changed 11 years ago by dante

(In [13684]) refs #6668 - shows how a fisheyelite can be destroy(true)'d and be re-applied with no leaking.

comment:4 Changed 11 years ago by dante

(In [13692]) refs #6668 - I missed themeTester. how could I?

comment:5 Changed 11 years ago by dante

(In [13693]) refs #6668 - also touch the quirksmode themetester, again missed by mistake.

comment:6 Changed 11 years ago by dante

Resolution: fixed
Status: assignedclosed

this was merged prior to [13684]. The other refs in this ticket refer to a test case change and are unrelated.

Note: See TracTickets for help on using tickets.