3.2.0

getElmementById

It doesn´t work properly the document.getElementById
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html class="aw-all aw-quirks aw-gecko aw-xp aw-ff3 aw-png2"><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">


<title>ActiveWidgets Examples</title>

<!-- fix box model in firefox/safari/opera -->
<style type="text/css">
.aw-quirks * {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}

body {font: 12px Tahoma}
</style>

<!-- include links to the script and stylesheet files -->
<script src="single%20row_files/aw.js" type="text/javascript"></script>
<link href="single%20row_files/aw.css" rel="stylesheet">

<!-- change default styles, set control size and position -->
<style type="text/css">

#myGrid {height: 150px}

</style>
</head><body>
<h3>Selection modes - single row</h3>
<p>Use setSelectionMode("single-row")</p>
<pre> grid.setSelectionMode("single-row"); </pre>

<!-- insert control tag -->
<span id="myGrid" class="aw-system-control aw-grid-control aw-selectors-hidden" tabindex="-1" hidefocus="true" oncontextmenu="AW(this,event)" onselectstart="return false"><span id="myGrid-box" class="aw-grid-box" onactivate="AW(this,event)"><textarea id="myGrid-box-focus" class="aw-control-focus" tabindex="0" onbeforedeactivate="AW(this,event)" onselectstart="AW(this,event)" onbeforecopy="AW(this,event)" oncut="AW(this,event)" oncopy="AW(this,event)" onpaste="AW(this,event)"></textarea><span id="myGrid-scroll" class="aw-scroll-bars aw-scrollbars-both" style="visibility: inherit;" onresize="AW(this,event)" ondommousescroll="AW(this,event)"><span id="myGrid-scroll-box" class="aw-bars-box" tabindex="-1" onscroll="AW(this,event)"><span id="myGrid-scroll-box-spacer" class="aw-bars-spacer" style="height: 380px; width: 500px;"></span></span><span id="myGrid-scroll-content" class="aw-bars-content" style="right: 17px; bottom: 17px;" tabindex="-1"><span id="myGrid-view" class="aw-hpanel-template"><span id="myGrid-view-box" class="aw-hpanel-box"><span id="myGrid-view-box-top" class="aw-hpanel-top" style="height: 20px; visibility: inherit;"><span id="myGrid-headers" class="aw-templates-list aw-text-normal aw-grid-headers aw-header-0" style="height: 20px;" tabindex="-1"><span id="myGrid-headers-start" class="aw-row-start" style="width: 0pt;"></span><span id="myGrid-header-0" class="aw-item-template aw-templates-imagetext aw-sort-ascending aw-grid-header aw-column-0" title="" tabindex="-1"><span id="myGrid-header-0-box" class="aw-item-box"><span id="myGrid-header-0-box-image" class="aw-item-image aw-image-none"></span><span id="myGrid-header-0-box-ruler" class="aw-item-ruler"></span><span id="myGrid-header-0-box-text" class="aw-item-text"><span id="myGrid-header-0-box-text-sort" class="aw-grid-sort"></span></span></span></span><span id="myGrid-separator-0" class="aw-grid-separator aw-resizable-true" onmousedown="AW(this,event)"></span><span id="myGrid-header-1" class="aw-item-template aw-templates-imagetext aw-sort-none aw-grid-header aw-column-1" title="" tabindex="-1"><span id="myGrid-header-1-box" class="aw-item-box"><span id="myGrid-header-1-box-image" class="aw-item-image aw-image-none"></span><span id="myGrid-header-1-box-ruler" class="aw-item-ruler"></span><span id="myGrid-header-1-box-text" class="aw-item-text"><span id="myGrid-header-1-box-text-sort" class="aw-grid-sort"></span></span></span></span><span id="myGrid-separator-1" class="aw-grid-separator aw-resizable-true" onmousedown="AW(this,event)"></span><span id="myGrid-header-2" class="aw-item-template aw-templates-imagetext aw-sort-none aw-grid-header aw-column-2" title="" tabindex="-1"><span id="myGrid-header-2-box" class="aw-item-box"><span id="myGrid-header-2-box-image" class="aw-item-image aw-image-none"></span><span id="myGrid-header-2-box-ruler" class="aw-item-ruler"></span><span id="myGrid-header-2-box-text" class="aw-item-text"><span id="myGrid-header-2-box-text-sort" class="aw-grid-sort"></span></span></span></span><span id="myGrid-separator-2" class="aw-grid-separator aw-resizable-true" onmousedown="AW(this,event)"></span><span id="myGrid-header-3" class="aw-item-template aw-templates-imagetext aw-sort-none aw-grid-header aw-column-3" title="" tabindex="-1"><span id="myGrid-header-3-box" class="aw-item-box"><span id="myGrid-header-3-box-image" class="aw-item-image aw-image-none"></span><span id="myGrid-header-3-box-ruler" class="aw-item-ruler"></span><span id="myGrid-header-3-box-text" class="aw-item-text"><span id="myGrid-header-3-box-text-sort" class="aw-grid-sort"></span></span></span></span><span id="myGrid-separator-3" class="aw-grid-separator aw-resizable-true" onmousedown="AW(this,event)"></span><span id="myGrid-header-4" class="aw-item-template aw-templates-imagetext aw-sort-none aw-grid-header aw-column-4" title="" tabindex="-1"><span id="myGrid-header-4-box" class="aw-item-box"><span id="myGrid-header-4-box-image" class="aw-item-image aw-image-none"></span><span id="myGrid-header-4-box-ruler" class="aw-item-ruler"></span><span id="myGrid-header-4-box-text" class="aw-item-text"><span id="myGrid-header-4-box-text-sort" class="aw-grid-sort"></span></span></span></span><span id="myGrid-separator-4" class="aw-grid-separator aw-resizable-true" onmousedown="AW(this,event)"></span><span id="myGrid-headers-end" class="aw-item-template aw-grid-header aw-column-space"><span id="myGrid-headers-end-box" class="aw-item-box"></span></span></span></span><span id="myGrid-view-box-middle" class="aw-hpanel-middle" style="top: 20px; bottom: 0px;"><span id="myGrid-rows" class="aw-templates-list aw-grid-view"><span id="myGrid-rows-start" class="aw-view-top" style="height: 216px;"></span><span id="myGrid-row-2" class="aw-templates-list aw-text-normal aw-grid-row aw-row-2 aw-rows-normal aw-alternate-even" tabindex="-1"><span id="myGrid-row-2-start" class="aw-row-start" style="width: 0px;"></span><span id="myGrid-cell-0-2" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-0 aw-cells-normal" title="" tabindex="-1">cell 0.2</span><span id="myGrid-cell-1-2" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-1 aw-cells-normal" title="" tabindex="-1">cell 1.2</span><span id="myGrid-cell-2-2" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-2 aw-cells-normal" title="" tabindex="-1">cell 2.2</span><span id="myGrid-cell-3-2" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-3 aw-cells-normal" title="" tabindex="-1">cell 3.2</span><span id="myGrid-cell-4-2" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-4 aw-cells-normal" title="" tabindex="-1">cell 4.2</span><span id="myGrid-row-2-end" class="aw-item-template aw-grid-cell aw-column-space"><span id="myGrid-row-2-end-box" class="aw-item-box"></span></span></span><span id="myGrid-row-3" class="aw-templates-list aw-text-normal aw-grid-row aw-row-3 aw-rows-normal aw-alternate-odd" tabindex="-1"><span id="myGrid-row-3-start" class="aw-row-start" style="width: 0px;"></span><span id="myGrid-cell-0-3" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-0 aw-cells-normal" title="" tabindex="-1">cell 0.3</span><span id="myGrid-cell-1-3" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-1 aw-cells-normal" title="" tabindex="-1">cell 1.3</span><span id="myGrid-cell-2-3" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-2 aw-cells-normal" title="" tabindex="-1">cell 2.3</span><span id="myGrid-cell-3-3" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-3 aw-cells-normal" title="" tabindex="-1">cell 3.3</span><span id="myGrid-cell-4-3" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-4 aw-cells-normal" title="" tabindex="-1">cell 4.3</span><span id="myGrid-row-3-end" class="aw-item-template aw-grid-cell aw-column-space"><span id="myGrid-row-3-end-box" class="aw-item-box"></span></span></span><span id="myGrid-row-4" class="aw-templates-list aw-text-normal aw-grid-row aw-row-4 aw-rows-normal aw-alternate-even" tabindex="-1"><span id="myGrid-row-4-start" class="aw-row-start" style="width: 0px;"></span><span id="myGrid-cell-0-4" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-0 aw-cells-normal" title="" tabindex="-1">cell 0.4</span><span id="myGrid-cell-1-4" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-1 aw-cells-normal" title="" tabindex="-1">cell 1.4</span><span id="myGrid-cell-2-4" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-2 aw-cells-normal" title="" tabindex="-1">cell 2.4</span><span id="myGrid-cell-3-4" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-3 aw-cells-normal" title="" tabindex="-1">cell 3.4</span><span id="myGrid-cell-4-4" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-4 aw-cells-normal" title="" tabindex="-1">cell 4.4</span><span id="myGrid-row-4-end" class="aw-item-template aw-grid-cell aw-column-space"><span id="myGrid-row-4-end-box" class="aw-item-box"></span></span></span><span id="myGrid-row-5" class="aw-templates-list aw-text-normal aw-grid-row aw-row-5 aw-rows-normal aw-alternate-odd" tabindex="-1"><span id="myGrid-row-5-start" class="aw-row-start" style="width: 0px;"></span><span id="myGrid-cell-0-5" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-0 aw-cells-normal" title="" tabindex="-1">cell 0.5</span><span id="myGrid-cell-1-5" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-1 aw-cells-normal" title="" tabindex="-1">cell 1.5</span><span id="myGrid-cell-2-5" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-2 aw-cells-normal" title="" tabindex="-1">cell 2.5</span><span id="myGrid-cell-3-5" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-3 aw-cells-normal" title="" tabindex="-1">cell 3.5</span><span id="myGrid-cell-4-5" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-4 aw-cells-normal" title="" tabindex="-1">cell 4.5</span><span id="myGrid-row-5-end" class="aw-item-template aw-grid-cell aw-column-space"><span id="myGrid-row-5-end-box" class="aw-item-box"></span></span></span><span id="myGrid-row-6" class="aw-templates-list aw-text-normal aw-grid-row aw-row-6 aw-rows-normal aw-alternate-even" tabindex="-1"><span id="myGrid-row-6-start" class="aw-row-start" style="width: 0px;"></span><span id="myGrid-cell-0-6" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-0 aw-cells-normal" title="" tabindex="-1">cell 0.6</span><span id="myGrid-cell-1-6" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-1 aw-cells-normal" title="" tabindex="-1">cell 1.6</span><span id="myGrid-cell-2-6" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-2 aw-cells-normal" title="" tabindex="-1">cell 2.6</span><span id="myGrid-cell-3-6" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-3 aw-cells-normal" title="" tabindex="-1">cell 3.6</span><span id="myGrid-cell-4-6" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-4 aw-cells-normal" title="" tabindex="-1">cell 4.6</span><span id="myGrid-row-6-end" class="aw-item-template aw-grid-cell aw-column-space"><span id="myGrid-row-6-end-box" class="aw-item-box"></span></span></span><span id="myGrid-row-7" class="aw-templates-list aw-text-normal aw-grid-row aw-row-7 aw-rows-normal aw-alternate-odd" tabindex="-1"><span id="myGrid-row-7-start" class="aw-row-start" style="width: 0px;"></span><span id="myGrid-cell-0-7" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-0 aw-cells-normal" title="" tabindex="-1">cell 0.7</span><span id="myGrid-cell-1-7" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-1 aw-cells-normal" title="" tabindex="-1">cell 1.7</span><span id="myGrid-cell-2-7" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-2 aw-cells-normal" title="" tabindex="-1">cell 2.7</span><span id="myGrid-cell-3-7" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-3 aw-cells-normal" title="" tabindex="-1">cell 3.7</span><span id="myGrid-cell-4-7" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-4 aw-cells-normal" title="" tabindex="-1">cell 4.7</span><span id="myGrid-row-7-end" class="aw-item-template aw-grid-cell aw-column-space"><span id="myGrid-row-7-end-box" class="aw-item-box"></span></span></span><span id="myGrid-row-8" class="aw-templates-list aw-text-normal aw-grid-row aw-row-8 aw-rows-selected aw-alternate-even" tabindex="-1"><span id="myGrid-row-8-start" class="aw-row-start" style="width: 0px;"></span><span id="myGrid-cell-0-8" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-0 aw-cells-normal" title="" tabindex="-1">cell 0.8</span><span id="myGrid-cell-1-8" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-1 aw-cells-normal" title="" tabindex="-1">cell 1.8</span><span id="myGrid-cell-2-8" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-2 aw-cells-normal" title="" tabindex="-1">cell 2.8</span><span id="myGrid-cell-3-8" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-3 aw-cells-normal" title="" tabindex="-1">cell 3.8</span><span id="myGrid-cell-4-8" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-4 aw-cells-normal" title="" tabindex="-1">cell 4.8</span><span id="myGrid-row-8-end" class="aw-item-template aw-grid-cell aw-column-space"><span id="myGrid-row-8-end-box" class="aw-item-box"></span></span></span><span id="myGrid-row-9" class="aw-templates-list aw-text-normal aw-grid-row aw-row-9 aw-rows-normal aw-alternate-odd" tabindex="-1"><span id="myGrid-row-9-start" class="aw-row-start" style="width: 0px;"></span><span id="myGrid-cell-0-9" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-0 aw-cells-normal" title="" tabindex="-1">cell 0.9</span><span id="myGrid-cell-1-9" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-1 aw-cells-normal" title="" tabindex="-1">cell 1.9</span><span id="myGrid-cell-2-9" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-2 aw-cells-normal" title="" tabindex="-1">cell 2.9</span><span id="myGrid-cell-3-9" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-3 aw-cells-normal" title="" tabindex="-1">cell 3.9</span><span id="myGrid-cell-4-9" class="aw-item-template aw-templates-cell aw-grid-cell aw-column-4 aw-cells-normal" title="" tabindex="-1">cell 4.9</span><span id="myGrid-row-9-end" class="aw-item-template aw-grid-cell aw-column-space"><span id="myGrid-row-9-end-box" class="aw-item-box"></span></span></span><span id="myGrid-rows-end" class="aw-item-template aw-row-selector aw-selector-space"><span id="myGrid-rows-end-box" class="aw-item-box"></span></span></span></span><span id="myGrid-view-box-bottom" class="aw-hpanel-bottom" style="height: 0px; display: none;"><span id="myGrid-footers" class="aw-templates-list aw-text-normal aw-grid-footers aw-footer-0" style="height: 20px;" tabindex="-1"><span id="myGrid-footers-start" class="aw-row-start" style="width: 0pt;"></span><span id="myGrid-footer-0" class="aw-item-template aw-templates-imagetext aw-grid-footer aw-column-0" title="" tabindex="-1"><span id="myGrid-footer-0-box" class="aw-item-box"><span id="myGrid-footer-0-box-image" class="aw-item-image aw-image-none"></span><span id="myGrid-footer-0-box-ruler" class="aw-item-ruler"></span><span id="myGrid-footer-0-box-text" class="aw-item-text"></span></span></span><span id="myGrid-footer-1" class="aw-item-template aw-templates-imagetext aw-grid-footer aw-column-1" title="" tabindex="-1"><span id="myGrid-footer-1-box" class="aw-item-box"><span id="myGrid-footer-1-box-image" class="aw-item-image aw-image-none"></span><span id="myGrid-footer-1-box-ruler" class="aw-item-ruler"></span><span id="myGrid-footer-1-box-text" class="aw-item-text"></span></span></span><span id="myGrid-footer-2" class="aw-item-template aw-templates-imagetext aw-grid-footer aw-column-2" title="" tabindex="-1"><span id="myGrid-footer-2-box" class="aw-item-box"><span id="myGrid-footer-2-box-image" class="aw-item-image aw-image-none"></span><span id="myGrid-footer-2-box-ruler" class="aw-item-ruler"></span><span id="myGrid-footer-2-box-text" class="aw-item-text"></span></span></span><span id="myGrid-footer-3" class="aw-item-template aw-templates-imagetext aw-grid-footer aw-column-3" title="" tabindex="-1"><span id="myGrid-footer-3-box" class="aw-item-box"><span id="myGrid-footer-3-box-image" class="aw-item-image aw-image-none"></span><span id="myGrid-footer-3-box-ruler" class="aw-item-ruler"></span><span id="myGrid-footer-3-box-text" class="aw-item-text"></span></span></span><span id="myGrid-footer-4" class="aw-item-template aw-templates-imagetext aw-grid-footer aw-column-4" title="" tabindex="-1"><span id="myGrid-footer-4-box" class="aw-item-box"><span id="myGrid-footer-4-box-image" class="aw-item-image aw-image-none"></span><span id="myGrid-footer-4-box-ruler" class="aw-item-ruler"></span><span id="myGrid-footer-4-box-text" class="aw-item-text"></span></span></span><span id="myGrid-footers-end" class="aw-item-template aw-grid-cell aw-column-space"><span id="myGrid-footers-end-box" class="aw-item-box"></span></span></span></span></span></span></span></span><span id="myGrid-box-sample" class="aw-row-sample aw-grid-row"></span><span id="myGrid-box-block"></span></span></span><br>
<span id="myLabel" class="aw-system-control aw-item-control aw-ui-label aw-text-expand" tabindex="-1" hidefocus="true" title="" oncontextmenu="return false" onselectstart="return false" onactivate="AW(this,event)"><span id="myLabel-box" class="aw-item-box"><span id="myLabel-box-image" class="aw-item-image aw-image-none"></span><span id="myLabel-box-ruler" class="aw-item-ruler"></span><span id="myLabel-box-text" class="aw-item-text" tabindex="-1">rows: [8]</span></span></span>

<p>Back to <a href="file:///C:/Documents%20and%20Settings/borja-1.adif/Escritorio/activewidgets-2.5.3-trial/ActiveWidgets/examples/grid%20behavior%20-%20selections/index.htm">selection examples</a>, <a href="file:///C:/Documents%20and%20Settings/borja-1.adif/Escritorio/activewidgets-2.5.3-trial/ActiveWidgets/examples/index.htm">all examples</a></p>
<tr>
<td class="TextoNegrita" width="250">Código de aplicación</td>
<td>
<input type="text" name="codigoApp" value="900" readonly="readonly" >
</td>
</tr>
<!-- create controls -->
<script type="text/javascript">

var grid = new AW.UI.Grid;
grid.setId("myGrid");
grid.setCellData(function(col, row){return "cell " + col + "." + row});
grid.setColumnCount(5);
grid.setRowCount(20);
grid.setSelectionMode("single-row"); // set selection mode to single row
grid.refresh();

var label = new AW.UI.Label;
label.setId("myLabel");
label.refresh();
grid.onRowClicked =
function(event, index){
alert("Row " + index + " clicked")
alert("adios");
document.write("This is my first JavaScript!" +document.getElementById("codigoApp").value);
alert("iii ");
alert("objCellText " + obj.getCellText(0,index));
};
grid.onSelectedRowsChanged = function(rowIndicesArray){
label.setControlText("rows: [" + rowIndicesArray + "]");
}

</script>
</body></html>
Borja
April 21,

This topic is archived.


Back to support forum