我有一个网格。在双击网格时,我需要获取表格的字段值..
网格代码:
<div class="claro" id="sdsfs" name="dataGrid" onclick="setWidgetproperty(this.id,'xy','inner__sdsfs')" ondblclick="editDataGridResponse(this.id)" onmouseup="setDocStyle(this.id)" style="height: 200px; left: 58px; position: absolute; top: 51px; width: 950px;">
<table class="claro" dojotype="dojox.grid.DataGrid" id="inner__sdsfs" rowselector="10px" style="height: 95%; width: 95%;">
<thead>
<tr>
<th field="Column1" width="100px">
Column1
</th>
<th field="Column2" width="100px">
Column2
</th>
<th field="Column3" width="100px">
Column3
</th>
<th field="Column4" width="100px">
Column4
</th>
<th field="Column5" width="100px">
Column5
</th>
</tr>
</thead>
</table>
<input id="hidden__sdsfs" name="dataGrid" style="display:none;" type="hidden">
</div>
我尝试了以下功能。但它不工作。
editDataGridResponse():
function editDataGridResponse(_sgridID){
var tableID = document.getElementById("inner__"+_sgridID);
for(var i=0; i<tableID.rows[0].length; i++){
alert(tableID.rows[0].field);
}
}