CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Combine Upload with ProgressBar

by JMiller » 09 Oct 2013 17:41

Hi there!

Is there a way to combine an Upload control with a ProgressBar?
The thing is, that I use the Upload for pictures. Depending on the size and our customers connection uploading can take several minutes, where there is no feedback.

As a plan B, can I connect the Upload control to the LockIndicator and show the user, that something is in progress.


Best regards,
JM
JMiller
 
Posts: 135
Joined: 13 Jul 2012 05:01

by Jorge Sousa » 09 Oct 2013 17:49

Hi

As you can see in:

http://www.cgdevtools.com/docs/html/IWC ... ptions.htm

you can use onprogress event.

But I suggest you to use JQFileUploadOptions.OnProgress.Script instread of JQFileUploadOptions.OnProgress.Script, since you don't exactly need the server for this.

As a plan B, can I connect the Upload control to the LockIndicator and show the user, that something is in progress.


No, the LockIndicator starts before and stops after an ajax event. The FileUpload is different.

Best Regards
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by JMiller » 10 Oct 2013 09:26

cgdevtools_support wrote:As you can see in:

http://www.cgdevtools.com/docs/html/IWC ... ptions.htm

you can use onprogress event.

The Link is not working, unless I quote your post and use what I find in there.
Something is wrong with the forum displaying links.

The Parameters passed by the OnProgress Event are:
IW_TrackID_=3
callback=IWCGJQFILEUPLOAD1FBLPBILD5.DoAjaxRequest
ajaxevent=JQFileUploadOptions.OnProgress
ComponentName=IWCGJQFileUpload1

If there was a parameter like "ProgressPercentage" I could do a
IWCGJQProgressBar1->JQProgressBarOptions->Value = AParams[4];

Nothing in your demos uses the OnProgress Events, so I can't figure out how to use it from that, either.

cgdevtools_support wrote:But I suggest you to use
JQFileUploadOptions.OnProgress.Script instread of
JQFileUploadOptions.OnProgress.Script, since you don't exactly need the server for this.


"Use A instead of A"?

I'd also have to learn JavaScript first, which is doable, but I still need some values to feed the script with.


Best regards,
JM
JMiller
 
Posts: 135
Joined: 13 Jul 2012 05:01

by Jorge Sousa » 10 Oct 2013 10:19

Hi

Sorry the link it's

http://www.cgdevtools.com/docs/html/index.htm

(we have to use the URL button)

Or the html / chm files installed.

The Parameters passed by the OnProgress Event are those and more JQFileUploadOptions.OnProgress.Arguments, if you use BrowserParams:

http://www.cgdevtools.com/cgforum/viewtopic.php?f=5&t=22

"Use A instead of A"?

I'd also have to learn JavaScript first, which is doable, but I still need some values to feed the script with.


Sorry again, I meant:

JQFileUploadOptions.OnProgress.Script instead of
JQFileUploadOptions.OnProgress.OnEvent, since you don't exactly need the server for this.

Using script instead server, is just because it doesn't seems correct to use the server just to Delphi/C++ translation to javascript.

Best Regards
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by tonyzhou » 16 Jul 2015 15:49

Why not write an example, let us get started?
tonyzhou
 
Posts: 112
Joined: 28 Jun 2015 13:02

by tonyzhou » 16 Jul 2015 15:52

function() {

var bar = $('.bar');
var percent = $('.percent');
var status = $('#status');

$('form').ajaxForm({
beforeSend: function() {
status.empty();
var percentVal = '0%';
bar.width(percentVal)
percent.html(percentVal);
},
uploadProgress: function(event, position, total, percentComplete) {
var percentVal = percentComplete + '%';
bar.width(percentVal)
percent.html(percentVal);
},
success: function() {
var percentVal = '100%';
bar.width(percentVal)
percent.html(percentVal);
},
complete: function(xhr) {
status.html(xhr.responseText);
}
});

}
tonyzhou
 
Posts: 112
Joined: 28 Jun 2015 13:02

by Alexander Bulei » 17 Jul 2015 09:23

Hi tonyzhou,

We have implemented the new property CGProgressBar in IWCGJQFileUpload in next build, accept TIWCGJQProgressBar only.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3637
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by tonyzhou » 17 Jul 2015 12:19

Great, great work.

Thanks your team.
tonyzhou
 
Posts: 112
Joined: 28 Jun 2015 13:02


Return to JQFileUpload

Who is online

Users browsing this forum: No registered users and 2 guests

Contact Us.