:: Forum >>

Shift+Select in version2

Hi,
I am using grid control version2. I want multiple selection of rows in my grid with Shift-Click working. I have set selectionMode to Multirow. It works only when I do Ctrl-Click. Shift-Click does not work. I have read in earlier post that it was not implemented in v2 beta3. Does anyone knows if it is implemented now and how to achieve this.

Thanks,
Sushma
Sushma
Friday, May 19, 2006
Shift-select is not implemented in AW 2.0. I am planning to add this in 2.1 later this year.
Alex (ActiveWidgets)
Wednesday, May 24, 2006
hi there,

here is an example of using Shift-Select.

<html>
<head>
    <!-- ActiveWidgets stylesheet and scripts -->
    <link href="../../runtime/styles/xp/aw.css" rel="stylesheet" type="text/css" ></link>
    <script src="../../runtime/lib/aw.js"></script>

</head>
<body>
    <script>

var obj = new AW.UI.Grid;
obj.setCellData("cell");
obj.setHeaderText("header");
obj.setColumnCount(10);
obj.setRowCount(10);
obj.setCellEditable(true);
    obj.setSelectorVisible(true);
    obj.setSelectorWidth(25);
    obj.setSelectorText(function(i){return this.getRowPosition(i)+1});
    obj.setSelectionMode("multi-row");

    Array.prototype.min = function(){
        return Math.min.apply({},this)
    }

obj.onSelectorMouseDown = function(event, index) {
        if (event.shiftKey) {
            var selmin=obj.getSelectedRows().min();
            var rowmin = Math.min(selmin,index);
            var rowmax = Math.max(selmin,index);
            selrows=[];
            for(i=rowmin; i<=rowmax; i++){
                selrows.push(i);
            }
            obj.setSelectedRows(selrows);
        }
     };

document.write(obj);

    
</script>
<br>
<button value="getSelectedRows" onClick="alert(obj.getSelectedRows());">get Selected Rows</button>
</body>
</html>
mono
Wednesday, June 7, 2006

This topic is archived.


Back to support forum

Forum search