Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#18500 closed defect (fixed)

the bug of GridContainer set colWidths

Reported by: gysheng Owned by: dylans <dylan@…>
Priority: undecided Milestone: 1.8.11
Component: DojoX Layout Version: 1.10.2
Keywords: Cc:
Blocked By: Blocking:

Description

I new a GridContainer?,then setColumns(4),then set("colWidths", [25,25,25,25]),then browers report a error: Uncaught TypeError?: Cannot read property '_dropMode' of undefined. The example code:

var gc1 = new GridContainer({
	id : gc1Id,
	region : 'center',
	minColWidth : 3,
	nbZones : portal.baseinf.userPortalConfig.colnum,
	hasResizableColumns : true,
	isAutoOrganized : false,
	colWidths : portal.baseinf.userPortalConfig.width,
	doLayout : true,
	acceptTypes : [ "Portlet" ]
});

gc1.setColumns(4);
gc1.set("colWidths", [25,25,25,25]);

then, I track the javascript,the execute path is: first:_setColWidthsAttr of GridContainerLite?,the code of _setColWidthsAttr is:

		_setColWidthsAttr: function(value){
			this.colWidths = lang.isString(value) ? value.split(",") : (lang.isArray(value) ? value : [value]);

			if(this._started){
				this._updateColumnsWidth();
			}
		},

in this function,there aren't any argument,when call _updateColumnsWidth. but in GridContainer?,the _updateColumnsWidth is:

		_updateColumnsWidth: function(/*Object*/ manager){
			// summary:
			//		Update the columns width.
			// manager:
			//		dojox.mdnd.AreaManager singleton
			// tags:
			//		private

			//console.log("dojox.layout.GridContainer ::: _updateColumnsWidth");
			this.inherited(arguments);
			manager._dropMode.updateAreas(manager._areaList);
		},

so,the code "manager._dropMode.updateAreas(manager._areaList)" will report a error. I changed the _updateColumnsWidth of GridContainer? to:

		_updateColumnsWidth: function(/*Object*/ manager){
			// summary:
			//		Update the columns width.
			// manager:
			//		dojox.mdnd.AreaManager singleton
			// tags:
			//		private

			//console.log("dojox.layout.GridContainer ::: _updateColumnsWidth");
			this.inherited(arguments);
			if (manager==null){
				manager=this._dragManager;
			}
			manager._dropMode.updateAreas(manager._areaList);
		},

then,fixed it.

Change History (6)

comment:1 Changed 4 years ago by dylan

Milestone: tbd1.11

comment:2 Changed 4 years ago by dylans <dylan@…>

Owner: set to dylans <dylan@…>
Resolution: fixed
Status: newclosed

In 90fd661e70ded72e8a2209a958f45524fc4df16a/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:3 Changed 4 years ago by dylans <dylan@…>

In aed4cee2ca8418989a03e0f7f0b7eb9f4314131f/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:4 Changed 4 years ago by dylans <dylan@…>

In 67ba99689029bd506817e27c2348537f79ace629/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:5 Changed 4 years ago by dylans <dylan@…>

In 63f7d71cb3fe0993450dcf4ef82cf9151b421a4f/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:6 Changed 4 years ago by dylan

Milestone: 1.111.8.11

Thanks @gysheng. This fix has landed in master and backported to 1.10.x, 1.9.x, and 1.8.x.

Note: See TracTickets for help on using tickets.