Jump to content

How can I determine when the Exporter has completed


Tinygoldwing

Recommended Posts

User clicks to export grid they are presented with a list of column title from the grid.  They can check or uncheck the ones they want to export.  They choose them and I set the remainder of the fields visible to false.  So far so good.  Works great.

However I can't determine when the exporter has completed to reset the columns visible property back.  I tried a bunch of ways to including setting a timer but that's a fixed value and no one would want to wait seconds to do this even though it finished seconds earlier.

Thank you for the help.

Ed

Link to comment
Share on other sites

  • 2 weeks later...
13 hours ago, Tinygoldwing said:

Where you able to find anything any solution?

Hello,

Solution for now (with some practical benefit): 

1. Form OnCreate event ->

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniDBGrid1.JSInterface do
  begin
    JSAddListener('beforedocumentsave', 'function(sender, params){ajaxRequest(sender, "_beforedocumentsave", {}, false)}');
    JSAddListener('documentsave', 'function(sender, params){ajaxRequest(sender, "_documentsave", {})}');
  end;
end;

2. UniDBGrid OnAjaxEvent ->

procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string;
  Params: TUniStrings);
begin
  if EventName = '_beforedocumentsave' then
  begin
    UniButton1.Enabled := False;
  end
  else if EventName = '_documentsave' then
  begin
    UniButton1.Enabled := True;
  end;

end;

 

  • Like 1
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...