obj.setSelectionMode("single-row");
obj2.setSelectionMode("single-row");
obj.onSelectedRowsChanged = function() { obj2.setSelectedRows([0]); };
<html>
<head>
<title>ActiveWidgets Grid :: Examples</title>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/xp/aw.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/aw.js"></script>
<!-- grid format -->
<style>
.aw-grid-control {height: 100; width: 100%; margin: 0px; border: none; font: menu;}
.aw-row-selector {text-align: center}
.aw-column-0 {width: 80px;}
.aw-column-1 {width: 200px;}
.aw-column-2 {text-align: right;}
.aw-column-3 {text-align: right;}
.aw-column-4 {text-align: right;}
</style>
</head>
<body>
<script>
var obj = new AW.UI.Grid;
obj.getCellText = function (i,j) {return i + ',' + j};
obj.getHeaderText = function (i) {return i };
obj.setRowCount(5);
obj.setColumnCount(5);
obj.setSelectionMode("single-row");
obj.onSelectedRowsChanged = function() { obj2.setSelectedRows([0]); };
document.write(obj);
</script>
<script>
var obj2 = new AW.UI.Grid;
obj2.getCellText = function (i,j) {return i + ',' + j};
obj2.getHeaderText = function (i) {return i };
obj2.setRowCount(5);
obj2.setColumnCount(5);
obj2.setSelectionMode("single-row");
document.write(obj2);
</script>
</body>
</html>
obj.onSelectedRowsChanged = function() {
setTimeout(function(){ obj2.setSelectedRows([obj.getSelectedRows()]) ,0})
};
This topic is archived.