<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>
This topic is archived.