Splitter Demo
you can use this usefull code example; if you have to use 2 grind in one form...
this demo shows how to resize the grids by a splitter...
<html>
<head>
<script src="shared/aw/lib/aw.js"></script>
<link href="shared/aw/styles/xp/aw.css" rel="stylesheet"></link>
<link href="skin/default/_skin.css" rel="stylesheet"></link>
<style>
#Flx1 {left:0; top:0; height:100%; width:100%;}
#Flx1 .aw-row-selector {width: 20px; text-align: center}
#Flx1 .aw-mouseover-row .aw-row-selector {color: red}
#Flx1 .aw-rows-selected .aw-row-selector {font-weight: bold}
#Flx1 .aw-alternate-even {background: #fff;}
#Flx1 .aw-alternate-odd {background: #eee;}
#Flx1 .aw-rows-selected {background: #316ac5}
#Flx1 .aw-grid-row {border-bottom: 1px solid threedlightshadow;}
#Flx1 .aw-grid-cell {border-right: 1px solid threedlightshadow;}
#Flx2 {left:0; top:0; height:100%; width:100%;}
#Flx2 .aw-row-selector {width: 20px; text-align: center}
#Flx2 .aw-mouseover-row .aw-row-selector {color: red}
#Flx2 .aw-rows-selected .aw-row-selector {font-weight: bold}
#Flx2 .aw-alternate-even {background: #fff;}
#Flx2 .aw-alternate-odd {background: #eee;}
#Flx2 .aw-rows-selected {background: #316ac5}
#Flx2 .aw-grid-row {border-bottom: 1px solid threedlightshadow;}
#Flx2 .aw-grid-cell {border-right: 1px solid threedlightshadow;}
</style>
</head>
<body scroll="no">
<table width=100% height=100% >
<tr><td>
Spliter Demo...
<tr height=100% ><td>
<table cellspacing=0 cellpadding=0 id=tab1 height=100% width=100%>
<tr><td id=pane1 width=250 style="cursor:col-resize; border-right:4px solid #E2DECD;"><span id="Flx1"></span>
<td><span id="Flx2"></span>
</tr>
</table>
</table>
<script>
var str = new AW.Formats.String;
var num = new AW.Formats.Number;
var Flx1 = new AW.UI.Grid;
Flx1.setId("Flx1");
Flx1.setHeaderText(["tantip", "tankod", "Maintaince Type"]);
Flx1.setCellFormat([num, num, str]);
Flx1.setColumnCount(3);
Flx1.setColumnWidth([0, 0, 200]);
Flx1.setSelectionMode("single-row");
var Flx2 = new AW.UI.Grid;
Flx2.setId("Flx2");
Flx2.setHeaderText(["tantip", "Code", "Description"]);
Flx2.setCellFormat([num, str, str]);
Flx2.setColumnCount(3);
Flx2.setColumnWidth([0, 80, 200]);
Flx2.setSelectionMode("single-row");
// Splitter/Sizer
document.write('<DIV Name="SP1" Id="SP1" style="border:1px solid #999; position:absolute; visibility:hidden; zIndex:999; height:100% ;fontSize:1px; background-Color:#999;"></DIV>');
var SP1 = document.getElementById('SP1');
var p = document.getElementById('pane1');
var Split_MinLeft;
var Split_X;
document.getElementById('pane1').attachEvent('onmousedown',splitDown);
function splitDown(){
if (event.offsetX > (p.offsetWidth-parseInt(p.style.borderRightWidth)) ) {
Split_MinLeft = event.clientX-event.offsetX;
Split_MinLeft = Split_MinLeft + 100;
Split_X = event.clientX;
SP1.style.left = Split_X-4;
SP1.style.top = 0;
SP1.style.width = 4;
SP1.style.height= document.body.clientHeight;
SP1.style.visibility='visible';
document.attachEvent('onmousemove', splitMove);
document.attachEvent('onmouseup', splitUp);
}
}
function splitMove(){
if (event.button==1){
SP1.style.left= (event.clientX >= Split_MinLeft) ? event.clientX : Split_MinLeft;
}
}
function splitUp(){
if (event.button==1){
p.width = p.offsetWidth + (parseInt(SP1.style.left) - Split_X);
SP1.style.visibility='hidden';
document.detachEvent('onmousemove', splitMove);
document.detachEvent('onmouseup', splitUp);
}
}
</script>
</body>
</html>
Serkan Eksi
June 13,