Jump to content

Recommended Posts

Posted

Hello UniGUI users !!

 

I would like to know if it is possible to change the behavior of escape shortCut while inserting a new row in a grid.

 

Actually, the behavior is as fallow:

  • you're editing the newly inserted row.
  • Press escape button
  • the whole line is deleted

We would like this behavior:

  • you're editing the newly inserted row.
  • Press escape button once
  • current cell's value is reset
  • Press escape button a second time.
  • The whole line is deleted.

How could we achieve something like that ?

 

Regards,

  • 3 weeks later...
Posted

Hi,

 

Hello UniGUI users !!

 

I would like to know if it is possible to change the behavior of escape shortCut while inserting a new row in a grid.

 

Actually, the behavior is as fallow:

 

  • you're editing the newly inserted row.
  • Press escape button
  • the whole line is deleted
We would like this behavior:

  • you're editing the newly inserted row.
  • Press escape button once
  • current cell's value is reset
  • Press escape button a second time.
  • The whole line is deleted.
How could we achieve something like that ?

 

Regards,

We will try to analyze this...

Posted

Can you try this solution as a "workaround" ?!

 

1. UniDBGrid1 -> ClientEvents -> ExtEvents ->

function canceledit(editor, context, eOpts)
{
    return false
}

2. UniDBGrid1 -> ClientEvents -> ExtEvents ->

function keydown(e, t, eOpts)
{
    if (e.keyCode == 27) {
        ajaxRequest(this.grid, '_cancel', []);        
    };
}

3. UniDBGrid1 -> OnAjaxEvent

procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string;
  Params: TUniStrings);
begin
  if EventName = '_cancel' then
    with (Sender as TUniDBGrid).DataSource.DataSet do
      if Active and (State in [dsInsert]) then
        Cancel;

end;

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