Subversion Repositories SmartDukaan

Rev

Rev 31905 | Rev 32074 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 31905 Rev 31917
Line 961... Line 961...
961
			= setTimeout(() => func.apply(context, args), delay)
961
			= setTimeout(() => func.apply(context, args), delay)
962
	}
962
	}
963
}
963
}
964
 
964
 
965
 
965
 
966
function ExportToExcel(container, type, fn, dl) {
966
function ExportToExcel(container, type, fn) {
967
	let tableId = $(container).data('tableid');
967
	let tableId = $(container).data('tableid');
968
	var elt = document.getElementById(tableId);
968
	var elt = document.getElementById(tableId);
969
	if ($.fn.DataTable.isDataTable(`#${tableId}`)) {
969
	if ($.fn.DataTable.isDataTable(`#${tableId}`)) {
970
		elt = $(`#${tableId}`).DataTable().table(0).container();
970
		elt = $(`#${tableId}`).DataTable().table(0).container();
971
	}
971
	}
972
	var wb = XLSX.utils.table_to_book(elt, { sheet: "sheet1" });
972
	var wb = XLSX.utils.table_to_book(elt, {sheet: "sheet1"});
973
	return dl ?
-
 
974
		XLSX.write(wb, {bookType: type, bookSST: true, type: 'base64'}) :
-
 
975
		XLSX.writeFile(wb, fn + '.' + (type || 'xlsx'));
973
	XLSX.writeFile(wb, fn || ('MySheetName.' + (type || 'xlsx')));
976
}
974
}
977
 
975
 
978
 
976
 
979
$(document).on('click', ".manage-pcm", function() {
977
$(document).on('click', ".manage-pcm", function() {
980
	managePCM();
978
	managePCM();