Our state of the art Gantt chart


Post by shimnx »

Since all interfaces in our system have permission verification, all interfaces need to add user Token information. Then how to add this parameter here?


pdfExport : {
                exportServer : environment.api+ '/app/project-task/Generate-Gantt-Pdf',

            // Development config
            translateURLsToAbsolute :true,
            openAfterExport:true,
            openInNewTab:false,
            listeners: {
                beforeRequest:(data)=>{
                    console.log(data)
                }
            },
            // For production replace with this one. See README.md for explanation
            // translateURLsToAbsolute : 'http://localhost:8080/resources/', // Trailing slash is important
            keepPathName : false
        },

Post by alex.l »

All the best,
Alex


Post by shimnx »

I did that but it didn't work

  pdfExport: {
                exportServer: environment.api + '/app/project-task/Generate-Gantt-Pdf',
                FetchOptions: {
                    body: JSON.stringify({}),
                    headers: {
                        'Authorization': 'Bearer ' + localStorage.getItem('token')
                    }
                },
                // Development config
                translateURLsToAbsolute: true,
                openAfterExport: true,
                openInNewTab: false,
                listeners: {
                    beforeRequest: (data) => {
                        console.log(data)
                    }
                },
                // For production replace with this one. See README.md for explanation
                // translateURLsToAbsolute : 'http://localhost:8080/resources/', // Trailing slash is important
                keepPathName: false
            },

Post by alex.l »

fetchOptions must start with lower case. I tested here https://bryntum.com/products/gantt/examples/export/ and I see it's working well.

All the best,
Alex


Post Reply