Jump to content

OnKeyDown and onKeyPress event not working with "UniDBTreeGrid"


Luciano França

Recommended Posts

Version 1.90.0.1568

I just need to use the onkeydown event of the "UniDBTreeGrid" component in the "UniBDgrid" component I can use normally

I tried to adapt a script you sent me about the same problem with Listbox but I couldn't

http://forums.unigui.com/index.php?/topic/23515-key-13-doesnt-work-with-listbox -bug-unigui/#comment-133601

Link to comment
Share on other sites

14 minutes ago, Sherzod said:

Can you make a simple testcase? 

 

function MainForm: TMainForm;
begin
  Result := TMainForm(UniMainModule.GetFormInstance(TMainForm));
end;

procedure TMainForm.UniDBTreeGrid1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
 if key = 13 then  // Does not work
  Showmessage('KeyDown'); 

 { In my application, when the customer enters the Grid, I perform several actions, such as Opening the change of a Chart of Accounts register. }

end;

procedure TMainForm.UniDBTreeGrid1KeyPress(Sender: TObject; var Key: Char);
begin
 if key = #13 then // Does not work
  Showmessage('KeyPress');
 
{ In my application, when the customer enters the Grid, I perform several actions, such as Opening the change of a Chart of Accounts register. }

end;

initialization
  RegisterAppFormClass(TMainForm);

end.

 

Unigui OnKeyDown TreedbGrid.7z

Link to comment
Share on other sites

1 hour ago, Luciano França said:

I tried to adapt a script you sent me about the same problem with Listbox but I couldn't

Try this:

function afterrender(sender, eOpts)
{
    sender.getView().addListener('itemkeydown', function(cmp, record, item, index, e, eOpts) {
        ajaxRequest(sender, 'keydown', {
            key: e.keyCode
        })
    });
}

 

Link to comment
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.

Guest
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...