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