Opened 14 years ago
Closed 13 years ago
#4076 closed defect (fixed)
use constructor to initialize hash or array variables, postscript to do widget lifecycle stuff
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 )
- in Widget.js, call create() from postscript() rather than constructor():
postscript: function(params, srcNodeRef){ // this happens only after all construction is done this.create(params, srcNodeRef); },
- certain widgets have code in preamble(). move that to constructor() instead.
- ValidationTextBox? and Combobox have code like
if(this.query==dijit.form.ComboBoxMixin.prototype.query){this.query={};}
to make sure that each widget gets it's own copy of query (but that we don't overwrite a parameter specified to the widget constructor (and mixed in to the widget). Should be changed to simpler
constructor: function(){ this.query={}; }
Change History (4)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Description: | modified (diff) |
---|---|
Summary: | use preamble to initialize hash or array variables → use constructor to initialize hash or array variables, postscript to do widget lifecycle stuff |
Scott says we should stop using preamble because it will break if it's called from a mixin (meaning, it will execute too late for our purposes). Changing bug description for new approach.
comment:3 Changed 14 years ago by
Owner: | set to bill |
---|---|
Status: | new → assigned |
comment:4 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
(In [10412]) 1. in Widget.js, call create() from postscript() rather than constructor()
- for widgets using preamble(), move code in preamble() to constructor() instead.
- change ValidationTextBox? and Combobox to use constructor to initialize arrays/hashes, rather than if() statement referencing prototype
Fixes #4076.
Note: See
TracTickets for help on using
tickets.
See [10190] for example.