Jump to content

Validation Bug when using two TUniDBEdits in Grid


MarkB

Recommended Posts

I have a DBGrid with 4 fields, the first 2 are required and the Grid has RowEditor enabled.

Those two Columns have a TUniDBEdit control associated with them.

If I click the Plus button on the navigator, enter only data in the first field and click Confirm, I get a warning that the second field is required but the RowEditor stops responding to mouse clicks after that.

image.png.e832e301e10f48dcf0bf949f1b260a99.png

 

UniguiValidationBug.zip

Link to comment
Share on other sites

On 3/5/2020 at 4:57 AM, MarkB said:

If I click the Plus button on the navigator, enter only data in the first field and click Confirm, I get a warning that the second field is required but the RowEditor stops responding to mouse clicks after that.

I opened a ticket in the support portal.

One of the possible solutions for your case:

UniDBGrid1.ClientEvents.ExtEvents -> 

function validateedit(editor, context, eOpts)
{
    return (context.newValues[0] != "" && context.newValues[1] != "")
}

 

Link to comment
Share on other sites

  • 3 years later...

Something like this:

1.

function validateedit(editor, context, eOpts)
{
    if (context.newValues[0] == "" || !context.newValues[0]) {
        ajaxRequest(this, 'vedit', {});
        return false;
    }
}

2. 

procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string;
  Params: TUniStrings);
begin
  if EventName = 'vedit' then
  begin
    ShowMessage('!');
  end;

end;

 

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