|
26 | 26 | var e = this;
|
27 | 27 |
|
28 | 28 | e.template = {
|
29 |
| - head: "<html xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns=\"http://www.w3.org/TR/REC-html40\"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets>", |
| 29 | + head: "<html xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns=\"http://www.w3.org/TR/REC-html40\"><meta http-equiv=\"content-type\" content=\"application/vnd.ms-excel; charset=UTF-8\"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets>", |
30 | 30 | sheet: {
|
31 | 31 | head: "<x:ExcelWorksheet><x:Name>",
|
32 | 32 | tail: "</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet>"
|
|
50 | 50 | e.tableRows.push(tempRows);
|
51 | 51 | });
|
52 | 52 |
|
53 |
| - e.tableToExcel(e.tableRows, e.settings.name); |
| 53 | + e.tableToExcel(e.tableRows, e.settings.name, e.settings.sheetName); |
54 | 54 | },
|
55 | 55 |
|
56 |
| - tableToExcel: function (table, name) { |
| 56 | + tableToExcel: function (table, name, sheetName) { |
57 | 57 | var e = this, fullTemplate="", i, link, a;
|
58 | 58 |
|
59 | 59 | e.uri = "data:application/vnd.ms-excel;base64,";
|
|
65 | 65 | return c[p];
|
66 | 66 | });
|
67 | 67 | };
|
| 68 | + |
| 69 | + sheetName = typeof sheetName == "undefined" ? "Sheet" : sheetName; |
| 70 | + |
68 | 71 | e.ctx = {
|
69 | 72 | worksheet: name || "Worksheet",
|
70 |
| - table: table |
| 73 | + table: table, |
| 74 | + sheetName: sheetName, |
71 | 75 | };
|
72 | 76 |
|
73 | 77 | fullTemplate= e.template.head;
|
74 | 78 |
|
75 | 79 | if ( $.isArray(table) ) {
|
76 | 80 | for (i in table) {
|
77 |
| - //fullTemplate += e.template.sheet.head + "{worksheet" + i + "}" + e.template.sheet.tail; |
78 |
| - fullTemplate += e.template.sheet.head + "Table" + i + "" + e.template.sheet.tail; |
| 81 | + //fullTemplate += e.template.sheet.head + "{worksheet" + i + "}" + e.template.sheet.tail; |
| 82 | + fullTemplate += e.template.sheet.head + sheetName + i + e.template.sheet.tail; |
79 | 83 | }
|
80 | 84 | }
|
81 | 85 |
|
|
0 commit comments