私は私が実際にコードのブランチを作成し、それを適切に行うことによって行われますが、時間の制約を与えてくれたものよりも少し良くそれを行うだろう時間を持っていた場合が、私は何を私、それが働いて得ることができましたうまく働いている。
はFYI、ここで私はそれは私が望んでやってきてしまった方法があります:私だけのための変更を実装しましたので、私のグリッドオプション
、私は(グリッドメニューでCSVのエクスポートオプションをオフにPDF)。
私はそれがcustom.exporter.js名付け、exporter.jsのコピーを作成し、新しいファイルを指すように私の参照を変更しました。 custom.exporter.jsで
、私はのgetData関数のコピーを作り、getGridRowsそれを命名。 getGridRowsはgetDataと同じですが、列などを取得するすべてのものがなくてもrowsオブジェクトを返す点を除いては同じです。今のところ、私は既知の列のセットで動作するようにコーディングしているので、すべてを必要としません。
私は次のようにpdfExport機能を変更:
pdfExport: function (grid, rowTypes, colTypes) {
var self = this;
var exportData = self.getGridRows(grid, rowTypes, colTypes);
var docContent = [];
$(exportData).each(function() {
docContent.push(
{
table: {
headerRows: 1,
widths: [70, 80, 150, 180],
body: [
[{ text: 'Job Raised', bold: true, fillColor: 'lightgray' }, { text: 'Job Number', bold: true, fillColor: 'lightgray' }, { text: 'Client', bold: true, fillColor: 'lightgray' }, { text: 'Job Title', bold: true, fillColor: 'lightgray' }],
[formattedDateTime(this.entity.JobDate,false), this.entity.JobNumber, this.entity.Client, this.entity.JobTitle],
]
}
});
var subGridContentBody = [];
subGridContentBody.push([{ text: 'Defect', bold: true, fillColor: 'lightgray' }, { text: 'Vendor', bold: true, fillColor: 'lightgray' }, { text: 'Status', bold: true, fillColor: 'lightgray' }, { text: 'Sign off', bold: true, fillColor: 'lightgray' }]);
$(this.entity.Defects).each(function() {
subGridContentBody.push([this.DefectName, this.DefectVendor, this.DefectStatus, '']);
});
docContent.push({
table: {
headerRows: 1,
widths: [159, 150, 50, 121],
body: subGridContentBody
}
});
docContent.push({ text: '', margin: 15 });
});
var docDefinition = {
content: docContent
}
if (self.isIE()) {
self.downloadPDF(grid.options.exporterPdfFilename, docDefinition);
} else {
pdfMake.createPdf(docDefinition).open();
}
}
を使用すると、データ・テーブルを試してみました。 https://www.datatables。ネット/それはjqueryベースであり、これを行うjqの拡張機能があります。さらに、データテーブルは非常に敏感です。 UIグリッドはlibを非常に不必要に複雑にしました。 – Gary