Reputation: 1
I integrated the WebDataRocks pivot table with an Angular app using as shown below and set the global datasource filename URL to the filed served by a local nodejs server:
var pivot = new WebDataRocks({
container: wdrContainerId,
toolbar: true,
height: wdrContainerElement.offsetHeight,
width: wdrContainerElement.offsetWidth,
global: {
dataSource: {
type: "csv",
filename: "http://localhost:3000/myfile.csv"
}
},
beforetoolbarcreated: customizeToolbar,
reportcomplete: function() {}
});
WebDataRocks Pivot displayed the error "File not found", so I used Chrome Developer Tools to check the file HTTP request URL, and noticed that WebDataRocks appends a Unix timestamp, such as 478925687, to the global.dataSource.filename URL as a query parameter.
What I see in Chrome Developer Tools: Request URL: http://localhost:3000/myfile.csv?478925687
I didn't find any documentation about this appended timestamp query parameter, and would like to know why it's appended and if it can be removed. Currently, I am just stripping it off the URL in my local NodeJS web server to avoid the HTTP404 error.
I didn't expect WebDataRocks Pivot to append the timestamp query parameter to the global.dataSource.fileName URL string, and expected WebDatarocks to use the same URL that I entered (i.e. http://localhost:3000/myfile.csv) to fetch the file. However, WebDataRocks appended a Unixtimestamp value 478925687 to the URL, which initially resulted in my web server returning HTT404 error, and WebDataRocks displaying HTTP404 error before I added a temporary handler in my local NodeJS server to strip the query param string.
Upvotes: 0
Views: 43
Reputation: 81
Short answer: there is no clear solution out of the box Your workaround to strip the timestamp off of the URL seems like the only way for now The reason they added this timestamp is to handle browser cache, as for browsers different URLs are different files
Upvotes: 0