How to move up & down in datatable?
Hi,All
I want to move focus by direction key in datatable,now,left & right be ok,up or down be not,code as folloing:
<ui:table augmentTitle="false" binding="#{inputData.table1}" id="table1"
style="left: 195px; top: 155px; position: absolute; width: 805px" width="811">
<script><![CDATA[
............
/* key event */
function document.onkeydown()
{
switch(event.keyCode)
{
case 39:
case 40:
GoOtherText(1);
break;
case 37:
case 38:
GoOtherText(-1);
break;
default:
break;
}
}
function GoOtherText(iDirection)
{
var i= event.srcElement.sourceIndex;
var obj = document.all[i+iDirection];
while(i>=0 && obj.tagName.toUpperCase() !="INPUT")
{
obj = document.all[i+iDirection];
i+= iDirection;
if(i==-1||i>=document.all.length)return;
}
window.status = i;
if(obj.tagName.toUpperCase() =="INPUT" && obj.type=="text" )
{
obj.focus();
obj.select();
}
}
]]></script>
<ui:tableRowGroup binding="#{inputData.tableRowGroup1}" id="tableRowGroup1" rows="10"
sourceData="#{inputData.khdfSessionGetAmmeterByBooknumForInputData1}" sourceVar="currentRow">
<ui:tableColumn align="center" binding="#{inputData.tableColumn13}" headerText="nowdata" id="tableColumn13"
onKeyDown="document.onkeydown()" width="88">
<ui:textField binding="#{inputData.copydataText}" converter="#{inputData.bigDecimalConverter1}" id="copydataText"
onChange="" onMouseOut="" readOnly="#{inputData.khdfSessionGetAmmeterByBooknumForInputData1.value['jfbz']}"
style="text-align: right; width: 69px" text="#{currentRow.value['copydata']}"/>
</ui:tableColumn>
</ui:tableRowGroup>
</ui:table>

