Skip to content

Commit 1233147

Browse files
committed
[DASH-49] Create Export to PDF
removed Ext.Error.raise call and debugger line; Corrected typo
1 parent 0c34e39 commit 1233147

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

jspdf.plugin.cell.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525

2626
(function (jsPDFAPI) {
27-
'use strict';
27+
// 'use strict';
2828

2929
var maxLn = 0,
3030
lnP = 0,
@@ -57,6 +57,7 @@
5757
fontName = this.internal.getFont().fontName;
5858
fontSize = this.internal.getFontSize();
5959
fontStyle = this.internal.getFont().fontStyle;
60+
6061
var px2pt = 1.545454545454545454545454,
6162
dimensions,
6263
text;
@@ -116,7 +117,7 @@
116117
}
117118

118119
var curCell = getLastCellPosition(),
119-
dim = this.getTextDimentions(txt),
120+
dim = this.getTextDimensions(txt),
120121
isNewLn = 1;
121122
if (curCell.x !== undefined && curCell.ln === ln) {
122123
x = curCell.x + curCell.w;
@@ -146,9 +147,11 @@
146147

147148
/**
148149
* Create a table from an {#Ext.data.Store} or a set of data.
149-
* @param dataSet {Ext.data.Model[]|Ext.data.Store}
150-
* @param [headers] {Array} Omit or null to auto-generate headers at a performance cost
151-
* @param [autoSize=true] {Boolean}
150+
* @param {Ext.data.Model[]|Ext.data.Store} dataSet
151+
* @param {Array} [headers] Omit or null to auto-generate headers at a performance cost
152+
* @param {Object} [config.printColumnHeaders] True to print column headers at the top of every page
153+
* @param {Object} [config.autoSize] True to dynamically set the column widths to match the widest cell value
154+
* @param {Object} [config.autoStretch] True to force the table to fit the width of the page
152155
*/
153156
jsPDFAPI.table = function(dataSet, headers, config){
154157

@@ -163,7 +166,7 @@
163166
}
164167

165168
if(!dataSet){
166-
Ext.Error.raise('No data for PDF table');
169+
throw 'No data for PDF table';
167170
}
168171

169172
if(dataSet.isStore){
@@ -193,7 +196,6 @@
193196
for (var i = 0, ln = headers.length; i < ln; i++) {
194197
index = headers[i];
195198
columnMatrix[index] = Ext.Array.map(models, function(rec){
196-
debugger;
197199
if(!rec.get){
198200
console.log(rec.$className);
199201
}

0 commit comments

Comments
 (0)