Jump to content

OnSpecialkey UniDbgrid How to perform default key action

Recommended Posts

I need to perform default key action before focusing to the next unidbgrid column (change enter key to tab key)
because sometimes data is not posted to database
for now i use the code :

function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
  columns[i].editor = {
      selectOnFocus: true,
      xtype: 'numberfield'
      ,minValue: 0
      ,allowBlank : false
      ,groupable : false
if (columns[i].getEditor()) {
      columns[i].getEditor().on('specialkey', function (field, e) 
         if (e.getKey() == 13)
          // perform default key action, force update current edit value 
          // before focusing to the next column
          e.keyCode = e.TAB;
            return e.keyCode;

Windows 10
Delphi Tokyo
Google Chrome 59.0.3071.115


Thank you

Link to post
Share on other sites

Hi, Delphi Dev




This can happen if the value in the particular column is incorrect


if i comment the line 

 e.keyCode = e.TAB;

data is always posted, but the next column is not focus (tab is not simulate)

Is it possible to update current value just like this thread ?


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...