Hi! We managed to do it by removing from the JSON config file of the designer the option that adds the status bar. This code:
{
"position": "bottom",
"command": "statusBarPanel",
"uiTemplate": "statusBarPanelTemplate"
}
Then we added a new status bar programatically:
const statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.querySelector('.bottom-panels'));
statusBar.bind(spread);
statusBar.add(
new GC.Spread.Sheets.StatusBar.StatusItem('loadingStatus', {
menuContent: 'Loading status',
value: 'Loading: 0%',
itemName: 'loadingStatus',
showStatusInContexMenu: false,
})
);
This way we have a custom item in the status bar. The issue we are facing now is that the value of this item is not updated when doing this:
spread.fromJSON(JSON.parse(workbook), {
doNotRecalculateAfterLoad: true,
incrementalLoading: {
loaded: () => {
onWorkpaperLoaded()();
},
loading: progress => {
const loadingStatus = statusBar.get('loadingStatus');
const loadingProgress = (progress * 100).toFixed(2);
loadingStatus.value = `Loading: ${loadingProgress}%`;
statusBar.update();
},
},
});
Is there something we are doing wrong when updating the status bar item value?
The only way we found to solve it was to remove the custom item and add it again with the new value, like this:
spread.fromJSON(JSON.parse(workbook), {
doNotRecalculateAfterLoad: true,
incrementalLoading: {
loaded: () => {
onWorkpaperLoaded()();
},
loading: progress => {
const loadingProgress = (progress * 100).toFixed(2);
statusBar.remove('loadingStatus');
statusBar.add(
new GC.Spread.Sheets.StatusBar.StatusItem('loadingStatus', {
menuContent: 'Loading status',
value: `Loading: ${loadingProgress}%`,
itemName: 'loadingStatus',
showStatusInContexMenu: false,
})
);
},
},
});
But we don’t think is the optimal approach. Any ideas?
Thanks!