unidbgrid单元格操作


unidbgrid单元格操作

//GRID里回车替换TAB
function cellkeydown(sender, td, cellIndex, record, tr, rowIndex, e, eOpts)
{
if (e.getKey()==13){var a=sender.editingPlugin;a.startEdit(record.index,cellIndex+1);}
}

a.startEdit(record.index,cellIndex+1)  // 这行代码也可以用于单元格定位焦点

 

动态添加clientevents,实现按回车向右移动:

 if unidbgrid1.ClientEvents.ExtEvents.Values['cellkeydown']='' then
  begin
     ClientEvents.ExtEvents.Values['cellkeydown']:='function cellkeydown(sender, td, cellIndex, record, tr, rowIndex, e, eOpts)'
     +'{'#13#10
     +'if (e.getKey()==13){var a=sender.editingPlugin;a.startEdit(record.index,cellIndex+1);}'#13#10
     +'}'#13#10;
  end;

实现按回车向下移动:

 if unidbgrid1.ClientEvents.ExtEvents.Values['cellkeydown']='' then
  begin
     ClientEvents.ExtEvents.Values['cellkeydown']:='function cellkeydown(sender, td, cellIndex, record, tr, rowIndex, e, eOpts)'
     +'{'#13#10
     +'if (e.getKey()==13){var a=sender.editingPlugin;a.startEdit(record.index+1,cellIndex);}'#13#10
     +'}'#13#10;
  end;
原文:https://www.cnblogs.com/wxb-km/p/5710146.html


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM