Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback downloadReady does not work #4666

Closed
denef opened this issue Jan 16, 2025 · 1 comment
Closed

Callback downloadReady does not work #4666

denef opened this issue Jan 16, 2025 · 1 comment
Labels
Documentation An issue with the tabulator.info documentation

Comments

@denef
Copy link

denef commented Jan 16, 2025

The callback downloadReady is never called.
It is actually commented and deprecated in code but not in the documentation.


var myTable = new Tabulator(tableFrame, {
    downloadReady:function(fileContents, blob){
          window.alert("File will be downloaded");
                  return true;} 
…

 myTable.download("csv", "file.csv") 

Compare:

https://tabulator.info/docs/6.3/callbacks#download

with:

https://github.com/olifolkerd/tabulator/blob/master/src/js/modules/Download/Download.js
line 18.

constructor(table){
		super(table);

		this.registerTableOption("downloadEncoder", function(data, mimeType){
			return new Blob([data],{type:mimeType});
		}); //function to manipulate download data
		// this.registerTableOption("downloadReady", undefined); //warn of function deprecation
		this.registerTableOption("downloadConfig", {}); //download config
		this.registerTableOption("downloadRowRange", "active"); //restrict download to active rows only

		this.registerColumnOption("download");
		this.registerColumnOption("titleDownload");
	}

	initialize(){
		this.deprecatedOptionsCheck();

		this.registerTableFunction("download", this.download.bind(this));
		this.registerTableFunction("downloadToTab", this.downloadToTab.bind(this));
	}

	deprecatedOptionsCheck(){
		// this.deprecationCheck("downloadReady", "downloadEncoder");
	}	
@denef denef added the Possible Bug A possible bug that needs investigation label Jan 16, 2025
@olifolkerd olifolkerd added Documentation An issue with the tabulator.info documentation and removed Possible Bug A possible bug that needs investigation labels Jan 19, 2025
@olifolkerd
Copy link
Owner

Hey @denef

Thanks for the headsup, looks like a documentation error there, i will get that fixed in todays patch update.

This functionality was replaced in the 6.0 release with the downloadEncoder:

https://tabulator.info/docs/6.3/download#advanced-intercept

Cheers

Oli :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation An issue with the tabulator.info documentation
Projects
None yet
Development

No branches or pull requests

2 participants