:: Forum >>

Shift + Ctrl + Select Behavior


Grid is not behaving as expected for Shift Ctrl Select (multi selection).
Also i am having multiple grids on the same screen.

Current behavior :-
Select rows from 2-4 with shift pressed.
Rows from 2 to 4 are selected.
Press Ctrl and select row no 6 .
Hold shift and select row 7, In existing grid , it'll select from row no 2-7.

Expected behavior :-
It should select from row no 6-7.

Whenever ctrl key is pressed , start index for selection should be last row selected.

To achieve the expected behavior , i've made some changes in aw.js for function toggleRow and includeRow

An array gridId is added.

When Ctrl is pressed , method toggleRow is called.

Code Added in toggleRow :-
var objId = this.getId();
gridId[0] = objId;
gridId[gridId.length - 1] = objId;

This will add objId in array whenever ctrl key is pressed.
In includeRow function (function called when shift key is pressed)

We check if grid Id is present in gridId array , then we reset startindex to the last row selected and remove the object from gridId array.

var objId = this.getId();
var tempArr = new Array();
var j=0;
for(var i=0;i<gridId.length;i++)
if(objId == gridId[i])
start = this.getRowPosition(rr[rr.length-1]); // start index is last
// row selected
tempArr[j] = gridId[i];
gridId = [];
gridId = tempArr;

With these changes in above mentioned functions , i got the desired behavior.
Ritu, Sharma
Wednesday, July 11, 2007
That's a good point, thank you!
Alex (ActiveWidgets)
Friday, July 13, 2007

This topic is archived.

Back to support forum

Forum search