Opened 12 years ago

Closed 11 years ago

Last modified 10 years ago

#10966 closed task (fixed)

[cla][patch] DateTextBox Calendar _populateGrid() called twice

Reported by: Jonathan Bond-Caron Owned by: bill
Priority: high Milestone: 1.5
Component: Dijit - Form Version: 1.4.0
Keywords: Cc:
Blocked By: Blocking:


After some debugging, I found that when the Calendar is used as a popup to DateTextBox?:

  • the _setValueAttr() method is called twice
  • the _populateGrid() method is called twice

This patch avoids setting the default value since we set it from the 'textbox' value:

this._picker.attr('value', this.attr('value')
new this.dateClassObj());

Attachments (1)

calendar_populateGrid.patch (916 bytes) - added by Jonathan Bond-Caron 12 years ago.

Download all attachments as: .zip

Change History (4)

Changed 12 years ago by Jonathan Bond-Caron

Attachment: calendar_populateGrid.patch added

comment:1 Changed 11 years ago by bill

Milestone: tbd1.5
Owner: set to bill
Status: newassigned
Type: enhancementtask

Thanks for catching that inefficiency. Unfortunately Calendar and DateTextBox have changed since you attached your patch, but anyway it turns out the problem can (and should) be solved by just passing in value to the Calendar constructor, rather than calling set('value', ...) afterwards.

comment:2 Changed 11 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [22426]) Pass value into Calendar constructor, rather than calling set('value', ...) right after construction. Avoids extra call to _populateGrid(). Fixes #10966 !strict.

comment:3 Changed 10 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.