Opened 11 years ago

Closed 11 years ago

#6823 closed defect (fixed)

[dojox.grid] some onEvents firing twice

Reported by: dante Owned by: Bryan Forbes
Priority: high Milestone: 1.2
Component: DojoX Grid Version: 1.1.0
Keywords: Cc:
Blocked By: Blocking:

Description

connecting to a grid's onCellClick and onCellDblClick results multiple events firing. with both connections, a single click on a cell fires the event twice. a double click on the cell fires two single clicks (with two events each) and a double click, which is also duplicated, for a grand total of 6 fires per double click.

try:

dojo.addOnLoad(function(){
	var eventCount = 0;
	dojo.forEach(["onCellClick","onCellDblClick"], function(ev){
		dojo.connect(grid2, ev, function(e){
			console.log(ev,e, eventCount++);
		});
	});
})

anywhere there is a jsId="grid2"

Change History (3)

comment:1 Changed 11 years ago by dante

an updated version of the simple test in description shows a lot of noise:

dojo.addOnLoad(function(){
	
	var eventCount = 0;
	var _lastEvent = null;
	
	var events = [];
	for(var o in grid2){
		// danke wolfram
		if(o.indexOf("on") == 0){
			events.push(o);
		}
	}
	
	dojo.forEach(events, function(ev){
		dojo.connect(grid2, ev, function(e){
			console[(_lastEvent === e ? "warn" : "log")](ev, e, eventCount); 
			_lastEvent = e;
			eventCount++;
		});
	});

});

its just connecting to any public onEvent it finds. hope this helps.

comment:2 Changed 11 years ago by Bryan Forbes

Owner: changed from bryanforbes to Bryan Forbes

comment:3 Changed 11 years ago by Bryan Forbes

Resolution: fixed
Status: newclosed

(In [13826]) fixes #6823 !strict

  • Changed dojox.grid.keyEvents to dojox.grid.util.keyEvents (missed that one).
Note: See TracTickets for help on using tickets.