3.0.5

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
May 19,
Shift-select is not implemented in AW 2.0. I am planning to add this in 2.1 later this year.
Alex (ActiveWidgets)
May 24,
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
June 7,

This topic is archived.

See also:


Back to support forum