Displaying Progress Indicators
Summary
- AdapTable makes it possible to display a Progress Indicator during a long-running operation
AdapTable allows developers to create Progress Indicators when an operation takes a significant time to run.
Find Out More
It is also possible to display Custom Window Popups to display more general information
Developers can either simply provide the text to display and use AdapTable's default rendering, or can provide custom rendering which will be used instead.
Show and hide Progress Indicators via User Interface API:
showProgressIndicator— displays the indicator (default or custom rendering)hideProgressIndicator— closes the indicator
Deep Dive
Configuring the Progress Indicator
Developer Guide
Providing a Progress Indicator
const config: ProgressIndicatorConfig = {
text: 'This standard Progress Indicator will display for 5 seconds',
};Provide text on ProgressIndicatorConfig for AdapTable's default spinner and message. Omit render and frameworkComponent.
const config: ProgressIndicatorConfig = {
text: 'Custom Indicator',
render: () =>
'<div style="padding:10px"><b>Custom progress content</b></div>',
};
const dialogConfig: ProgressIndicatorConfig = {
text: 'New Dialog',
renderMode: 'dialog',
render: () =>
'<div style="padding:10px"><b>Fully custom dialog content</b></div>',
};Supply a render function that returns HTML. It receives CustomRenderContext when you need lifecycle hooks (phase, element, adaptableApi).
renderMode: 'content'(default) — custom HTML appears inside AdapTable's progress dialog together with the spinnerrenderMode: 'dialog'— your HTML replaces the default dialog entirely
Optional delay (milliseconds) defers showing the indicator until the operation has run for that long.
onClick: (button, context) => {
context.adaptableApi.userInterfaceApi.showProgressIndicator(config);
},Call showProgressIndicator wherever you have adaptableApi — for example a Custom Toolbar Button onClick handler.
setTimeout(() => {
context.adaptableApi.userInterfaceApi.hideProgressIndicator();
}, 5000);Call hideProgressIndicator when the long-running task finishes (the demo uses a 5-second timeout).
- This example contains 3 Custom Toolbar Buttons that each open a Progress Indicator:
Show Standard Progress Indicator- displays the text it is given and uses the default AdapTable renderingShow Custom Progress Indicator- displays using custom rendering that was suppliedShow New Dialog Indicator- displays using a replacement Dialog
- All 3 Progress Indicators display for 5 seconds (before being hidden via
hideProgressIndicator)
- Click the 3 toolbar buttons to see the associated Progress Indicators