Skip to content

Commit 0f23adf

Browse files
committed
Show column letters in grid
Originally the column labels were repeated in the top and in the first row; now it shows `A, B, C, ...` and the first row is properly frozen. h/t @Path2SharePoint (on Twitter) for noticing the issue.
1 parent 2aebc35 commit 0f23adf

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

assets/js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ var _onsheet = function(json, cols, sheetnames, select_sheet_cb) {
7676
stretchH: 'all',
7777
rowHeaders: true,
7878
columns: cols.map(function(x) { return {data:x}; }),
79-
colHeaders: cols,
79+
colHeaders: cols.map(function(x,i) { return XLS.utils.encode_col(i); }),
8080
cells: function (r,c,p) {
8181
if(r === 0) this.renderer = boldRenderer;
8282
},

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h3>
3333
Need a file? Why not the <a href="http://www.whitehouse.gov/sites/default/files/omb/budget/fy2014/assets/receipts.xls">OMB FY 2014 Federal Receipts?</a>
3434
</h3>
3535
<table id="tt">
36-
<tr><td colspan="6"><a href="osstatus.html">SheetJS Libraries</a> (for parsing) and <a href="http://handsontable.com">Handsontable</a> (grid component)</td></tr>
36+
<tr><td colspan="6"><a href="http://github.com/SheetJS/SheetJS.github.io">View Source</a>; <a href="osstatus.html">SheetJS Libraries</a> (for parsing) and <a href="http://handsontable.com">Handsontable</a> (grid component)</td></tr>
3737
<tr>
3838
<th>XLS/XML</th>
3939
<td><a href="http://github.com/SheetJS/js-xls">Library Source</a></td>

tests/test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ describe('should parse test files', function() {
12131213
"rich_text_stress.xlsx",
12141214
"roo_1900_base.xlsx",
12151215
"roo_1904_base.xlsx",
1216-
"roo_Bibelbund.xlsx.pending",
1216+
"roo_Bibelbund.xlsx",
12171217
"roo_Pfand_from_windows_phone.xlsx.pending",
12181218
"roo_bbu.xlsx",
12191219
"roo_boolean.xlsx",
@@ -1258,8 +1258,8 @@ describe('should parse test files', function() {
12581258
"xlrd_test_comments_excel.xlsx",
12591259
"xlrd_test_comments_gdocs.xlsx",
12601260
"xlrd_text_bar.xlsx",
1261-
"xlsx-stream-d-date-cell.xlsx"
1262-
//"חישוב_נקודות_זיכוי.xlsx.pending",
1261+
"xlsx-stream-d-date-cell.xlsx",
1262+
"apachepoi_חישוב_נקודות_זיכוי.xlsx.pending"
12631263
].forEach(function(x) {
12641264
it(x, x.substr(-8) == ".pending" ? null : function(done) {
12651265
var oReq;
@@ -1277,7 +1277,7 @@ describe('should parse test files', function() {
12771277
var arraybuffer = oReq.response;
12781278
data = new Uint8Array(arraybuffer);
12791279
for(i = 0; i != data.length; ++i) arr[i] = data[i];
1280-
wb = (x.substr(-1) == "s" || x.substr(-4) == ".xml") ? XLS.read(arr, {type:'array'})
1280+
wb = (x.substr(-1) == "s" || x.substr(-1) == "l") ? XLS.read(arr, {type:'array'})
12811281
: XLSX.read(arr.map(function(x) { return String.fromCharCode(x); }).join(""), {type:'binary'});
12821282
} else {
12831283
var binary = oReq.responseBody;
@@ -1291,7 +1291,7 @@ describe('should parse test files', function() {
12911291
var lastChr = IEBinaryToArray_ByteStr_Last(binary);
12921292
data = rawBytes.replace(/[\s\S]/g, function( match ) { return byteMapping[match]; }) + lastChr;
12931293
for(i = 0; i != data.length; ++i) arr[i] = data.charCodeAt(i) & 0xff;
1294-
wb = (x.substr(-1) == "s" || x.substr(-4) == ".xml") ? XLS.read(arr, {type:'array'})
1294+
wb = (x.substr(-1) == "s" || x.substr(-1) == "l") ? XLS.read(arr, {type:'array'})
12951295
: XLSX.read(arr.map(function(x) { return String.fromCharCode(x); }).join(""), {type:'binary'});
12961296
}
12971297
parsetest(x, wb);
@@ -1314,7 +1314,7 @@ describe('should parse test files', function() {
13141314
var data = rawBytes.replace(/[\s\S]/g, function( match ) { return byteMapping[match]; }) + lastChr;
13151315
var arr = [];
13161316
for(i = 0; i != data.length; ++i) arr[i] = data.charCodeAt(i) & 0xff;
1317-
wb = (x.substr(-1) == "s" || x.substr(-4) == ".xml") ? XLS.read(arr, {type:'array'})
1317+
wb = (x.substr(-1) == "s" || x.substr(-1) == "l") ? XLS.read(arr, {type:'array'})
13181318
: XLSX.read(arr.map(function(x) { return String.fromCharCode(x); }).join(""), {type:'binary'});
13191319
parsetest(x, wb);
13201320
done();

0 commit comments

Comments
 (0)