3.2.0

Shift + Ctrl + Select Behavior

Hi,

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

e.g
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();
if(!gridId.length){
gridId[0] = objId;
}else{
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
}else{
tempArr[j] = gridId[i];
j++;
}
}
gridId = [];
gridId = tempArr;

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

This topic is archived.

See also:


Back to support forum