JobProgress
TsgcHTMLComponent_JobProgress — render a live list of background job progress bars with status badges, cancel buttons and out-of-band fragment updates, in Delphi, C++ Builder and .NET.
TsgcHTMLComponent_JobProgress — render a live list of background job progress bars with status badges, cancel buttons and out-of-band fragment updates, in Delphi, C++ Builder and .NET.
Register jobs with AddJob, move them along with UpdateJob, then read HTML for the initial render or push a single row with GetJobFragmentHTML.
TsgcHTMLComponent_JobProgress
Bootstrap 5 progress-bar list + scoped CSS
Delphi, C++ Builder, .NET
Call AddJob to register a job, render the initial HTML, then on each progress tick call UpdateJob and broadcast GetJobFragmentHTML to refresh just that row.
uses
sgcHTML_Enums, sgcHTML_Component_JobProgress;
var
oJobs: TsgcHTMLComponent_JobProgress;
begin
oJobs := TsgcHTMLComponent_JobProgress.Create(nil);
try
oJobs.JobsID := 'exports';
oJobs.Title := 'Background Exports';
oJobs.ShowCompleted := False;
oJobs.AddJob('exp-42', 'Export customers.csv', 'Generating CSV export');
WebModule.Response := oJobs.HTML; // card + progress rows + cancel-form script
finally
oJobs.Free;
end;
end;
// On a later progress tick, push just that row over the WebSocket:
oJobs.UpdateJob('exp-42', 65, jsRunning);
Engine.BroadcastFragment(oJobs.GetJobFragmentHTML('exp-42'));
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_JobProgress.hpp
TsgcHTMLComponent_JobProgress *oJobs = new TsgcHTMLComponent_JobProgress(NULL);
try
{
oJobs->JobsID = "exports";
oJobs->Title = "Background Exports";
oJobs->ShowCompleted = false;
oJobs->AddJob("exp-42", "Export customers.csv", "Generating CSV export");
String html = oJobs->HTML; // card + progress rows + cancel-form script
}
__finally
{
delete oJobs;
}
// On a later progress tick, push just that row over the WebSocket:
oJobs->UpdateJob("exp-42", 65, jsRunning, "");
Engine->BroadcastFragment(oJobs->GetJobFragmentHTML("exp-42"));
using esegece.sgcWebSockets;
var jobs = new TsgcHTMLComponent_JobProgress();
jobs.JobsID = "exports";
jobs.Title = "Background Exports";
jobs.ShowCompleted = false;
jobs.AddJob("exp-42", "Export customers.csv", "Generating CSV export");
string html = jobs.HTML; // card + progress rows + cancel-form script
// On a later progress tick, push just that row over the WebSocket:
jobs.UpdateJob("exp-42", 65, TsgcHTMLJobStatus.jsRunning, "");
engine.BroadcastFragment(jobs.GetJobFragmentHTML("exp-42"));
The members you reach for most often.
AddJob(aId, aName, aDescription) registers a job and returns its TsgcHTMLJobItem (Id, Name, Description, Percent, Status, StatusText, StartedAt).
UpdateJob(aId, aPercent, aStatus, aStatusText) updates a job by id, clamping Percent to 0–100.
TsgcHTMLJobStatus (jsQueued, jsRunning, jsCompleted, jsFailed, jsCancelled) drives the badge and progress-bar color, striped and animated while running.
GetJobFragmentHTML/GetJobAppendFragmentHTML return out-of-band swap fragments for PushFragment/BroadcastFragment, so a tick updates one row instead of the whole page.
ShowCompleted hides finished jobs from the list; AutoRemoveCompleted drops them from Jobs entirely once completed.
ShowCancelButton, CancelCaption and CancelAction control the per-row Cancel form, posted through the same mechanism as Grid and Chat.
| Online HelpFull API reference and usage guide for this component. | Open | |
| All sgcHTML ComponentsBrowse the full feature matrix of 80+ components. | Open | |
| Download Free TrialThe 30-day trial ships the 60.HTML demo projects. | Open | |
| PricingSingle, Team and Site licenses with full source code. | Open |