From f9e2d6dd11ecfaecda4e1caebcc63df921ba8f73 Mon Sep 17 00:00:00 2001 From: Cyberiaaxis Date: Wed, 15 Sep 2021 09:35:06 +0530 Subject: [PATCH] fixed datagrid demo [ci skip] --- demos/datagrid/index.html | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/demos/datagrid/index.html b/demos/datagrid/index.html index ffd9268..158a798 100644 --- a/demos/datagrid/index.html +++ b/demos/datagrid/index.html @@ -34,7 +34,6 @@ a { text-decoration: none } ... or click here to select a file Advanced Demo Options: -Use readAsBinaryString: (when available)

@@ -80,22 +79,16 @@ var process_wb = (function() { })(); var do_file = (function() { - var rABS = typeof FileReader !== "undefined" && (FileReader.prototype||{}).readAsBinaryString; - var domrabs = document.getElementsByName("userabs")[0]; - if(!rABS) domrabs.disabled = !(domrabs.checked = false); - return function do_file(files) { - rABS = domrabs.checked; var f = files[0]; var reader = new FileReader(); reader.onload = function(e) { - if(typeof console !== 'undefined') console.log("onload", new Date(), rABS); + if(typeof console !== 'undefined') console.log("onload", new Date()); var data = e.target.result; - if(!rABS) data = new Uint8Array(data); - process_wb(X.read(data, {type: rABS ? 'binary' : 'array'})); + data = new Uint8Array(data); + process_wb(X.read(data, {type: 'array'})); }; - if(rABS) reader.readAsBinaryString(f); - else reader.readAsArrayBuffer(f); + reader.readAsArrayBuffer(f); }; })();