Jump to content

Recommended Posts

Posted

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

Posted
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] != "")
}

 

  • 3 years later...
Posted

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;

 

Posted

@SherzodThere's just one more detail left for me to finalize my dbgrid:
Is there any way I can pass a value to one of the roweditor fields via code, in the case of the example above, I wanted to send a value to the Field4 field via code, is there any way?
Something like "field(4).setValue" ? I can't do this!
Thanks again!

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