MarkB Posted March 4, 2020 Share Posted March 4, 2020 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. UniguiValidationBug.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 5, 2020 Share Posted March 5, 2020 I will open a ticket in the support portal. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 6, 2020 Share Posted March 6, 2020 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] != "") } Quote Link to comment Share on other sites More sharing options...
sicoobcooplivre Posted June 19, 2023 Share Posted June 19, 2023 @SherzodPlease, is there a possibility to display a showmessage with the validation of the field above? It worked just fine for my case, but I would like to display it in showmessage format! Thanks! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 19, 2023 Share Posted June 19, 2023 You can send an ajaxRequest to the server inside the validate function, before "return ..." Quote Link to comment Share on other sites More sharing options...
sicoobcooplivre Posted June 19, 2023 Share Posted June 19, 2023 @Sherzod Please help me assemble the code, as I still don't have that much knowledge! Thank you for your attention! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 19, 2023 Share Posted June 19, 2023 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; Quote Link to comment Share on other sites More sharing options...
sicoobcooplivre Posted June 19, 2023 Share Posted June 19, 2023 @Sherzod Perfect thank you! With your answers, I understood a little more about how to send from the client to the server, the question is to learn javascript! I will study, thank you! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 19, 2023 Share Posted June 19, 2023 I wish you good luck, there are many examples on the forum. Quote Link to comment Share on other sites More sharing options...
sicoobcooplivre Posted June 19, 2023 Share Posted June 19, 2023 @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! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 19, 2023 Share Posted June 19, 2023 39 minutes ago, Sherzod said: there are many examples on the forum. Try searching. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.