Webix Jet export to Excel failed for No 'Access-Control-Allow-Origin'

Hi there,

Sorry, problem solved.

Just an ajax event conflicted.

webix.ready(function(){
	
	if(!webix.env.touch && webix.ui.scrollSize && webix.CustomScroll)
		webix.CustomScroll.init();

	/*webix.attachEvent('onBeforeAjax',
	    function(mode, url, data, request, headers, files, promise){
	      headers['Content-type']= 'application/json';
	    }
    );*/	

after marked the onBeforeAjax event, all jobs worked fine.

James.

Hi there,

I just met a problem when exporting datatable data to Excel under Jet Framework (Webix Library Ver 5.2 Trail) by using

webix.toExcel($$(gridID), { styles: true, spans: true });

and Console log

Failed to load http://cdn.webix.com/extras/xlsx.core.styles.min.js: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:8080’ is therefore not allowed access.

Is this a limitation of trailed version? or can someone else had the same problem resolved.

Thanks.

James.

Hi,

Nope, using webix jet must not limit any functionality. Webix jet is just a way to organize code, it doesn’t affect core functionality of components.

check https://snippet.webix.com/oxxomxqj

That is webix jet based app, which correctly uses data export functionality.

Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present

This one is quite strange as if you check the mentioned url, it does have this header. You can try to open this url in the browser and check network panel of dev. tools - if header doesn’t present it possible that you have some proxy | firewall which intercepts the connection.

Thanks maksim. :slight_smile: