Opened 16 years ago

Closed 15 years ago

#2250 closed defect (fixed)

getSelectedData fails in single select mode when there is no selection

Reported by: [email protected] Owned by: Tom Trenka
Priority: high Milestone:
Component: General Version: 0.4.1
Keywords: Cc:
Blocked By: Blocking:


I added the highlighted part of the below method to handle the case where the table is in single select mode and there was no selection. It was trying to access the 0 index item of an empty array before this change.

  • Michael Latta
	getSelectedData: function(){
		//	summary
		//	returns all objects that are selected.
		var a=[];
		for(var i=0; i<data.length; i++){
		// *******************************************************************************
		// the following 3 lines are required to deal with single select mode and an empty selection
		if(a.length == 0) {
			return null;	// no current selection
		} else
		// *******************************************************************************
			return a;		//	array
		} else {
			return a[0];	//	object

Change History (2)

comment:1 Changed 15 years ago by Tom Trenka

Owner: changed from anonymous to Tom Trenka

comment:2 Changed 15 years ago by Tom Trenka

Resolution: fixed
Status: newclosed

(In [7026]) Fixes #2250.

Note: See TracTickets for help on using tickets.