Good afternoon, tell me if it is possible to change the error window when loading / synchronizing the gantt chart?
Support Forum
It is. You need to change it in localization. Find localization demo in "/examples/localization" folder, in /locales subfolder you'll see examples of locales. The line you need is
GridBase : {
loadFailedMessage : 'Wird geladen, bitte versuche es erneut!',
Here is the guide how to use custom locales https://bryntum.com/docs/gantt/guide/Gantt/customization/localization
All the best,
Alex
Gantt Version: 4.3.8
Returned response: code 500
body {"status":"FAILED","message":"Something error"}
However, the displayed error has not changed in any way.
Is there some render method that can be changed to affect the content of the error?
If not, can we make a change request?
I really want to be able to generate an error report and display it with such troubles
That's a bug, ticket is here https://github.com/bryntum/support/issues/4591
As a temp workaround, try to override CrudManagerView::onCrudManagerRequestFinalize
onCrudManagerRequestFinalize(successful = true, requestType, response) {
const me = this;
if (successful) {
me.masked = null;
me.toggleEmptyText?.();
}
else {
// Do not remove. Assertion strings for Localization sanity check.
// 'L{GridBase.loadFailedMessage}'
// 'L{GridBase.syncFailedMessage}'
me.applyMaskError(
`<div class="b-grid-load-failure">
<div class="b-grid-load-fail">${me.L(`L{GridBase.${requestType}FailedMessage}`)}</div>
${response && response.message ? `<div class="b-grid-load-fail">${me.L('L{CrudManagerView.serverResponseLabel}')} ${response.message}</div>` : ''}
</div>`);
}
}
response
is null
now (that's the actual bug). But you can get it using const responseString = this.project.decode()
;
All the best,
Alex
Can you tell me how to override this method?
Attempt to use Override failed
displayed error don't change
class CrudManagerViewOverride{
static get target() {
return {
class : CrudManagerView,
product : 'grid',
}
}
onCrudManagerRequestFinalize(successful, requestType, response){
const me = this;
if (successful) {
me.masked = null;
me.toggleEmptyText?.();
}
else {
// Do not remove. Assertion strings for Localization sanity check.
// 'L{GridBase.loadFailedMessage}'
// 'L{GridBase.syncFailedMessage}'
me.applyMaskError(`<div>SOMETHING</div>`);
}
}
}
Override.apply(CrudManagerViewOverride);
The easiest way to do that is to define that method in Gantt
const gantt = new Gantt({
appendTo : 'container',
dependencyIdField : 'wbsCode',
project : {
// ...
},
onCrudManagerRequestFinalize(successful, requestType, response){
const me = this;
if (successful) {
me.masked = null;
me.toggleEmptyText?.();
}
else {
// Do not remove. Assertion strings for Localization sanity check.
// 'L{GridBase.loadFailedMessage}'
// 'L{GridBase.syncFailedMessage}'
me.applyMaskError(`<div>SOMETHING</div>`);
}
},
All the best,
Alex