mirror of
https://github.com/zadam/trilium.git
synced 2025-11-26 02:24:23 +01:00
fix(print/table): missing title
This commit is contained in:
parent
749740242e
commit
c43820776f
@ -12,31 +12,36 @@ export default function TablePrintView({ note, noteIds, viewConfig }: ViewModePr
|
||||
const [ html, setHtml ] = useState<string>();
|
||||
|
||||
return rowData && (
|
||||
<div className="table-print-view">
|
||||
{!html ? (
|
||||
<Tabulator
|
||||
tabulatorRef={tabulatorRef}
|
||||
className="table-print-view-container"
|
||||
modules={[ PrintModule, ExportModule, FormatModule ]}
|
||||
columns={columnDefs ?? []}
|
||||
data={rowData}
|
||||
index="branchId"
|
||||
dataTree={hasChildren}
|
||||
printStyled={true}
|
||||
onReady={() => {
|
||||
const tabulator = tabulatorRef.current;
|
||||
if (!tabulator) return;
|
||||
const generatedTable = tabulator.modules.export.generateTable(tabulator.options.printConfig, tabulator.options.printStyled, tabulator.options.printRowRange, "print");
|
||||
if(tabulator.options.printFormatter){
|
||||
tabulator.options.printFormatter(tabulator.element, generatedTable);
|
||||
}
|
||||
setHtml(generatedTable.outerHTML);
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<RawHtmlBlock html={html} className="tabulator-print-fullscreen" />
|
||||
)}
|
||||
</div>
|
||||
<>
|
||||
<h1>{note.title}</h1>
|
||||
|
||||
<div className="table-print-view">
|
||||
|
||||
{!html ? (
|
||||
<Tabulator
|
||||
tabulatorRef={tabulatorRef}
|
||||
className="table-print-view-container"
|
||||
modules={[ PrintModule, ExportModule, FormatModule ]}
|
||||
columns={columnDefs ?? []}
|
||||
data={rowData}
|
||||
index="branchId"
|
||||
dataTree={hasChildren}
|
||||
printStyled={true}
|
||||
onReady={() => {
|
||||
const tabulator = tabulatorRef.current;
|
||||
if (!tabulator) return;
|
||||
const generatedTable = tabulator.modules.export.generateTable(tabulator.options.printConfig, tabulator.options.printStyled, tabulator.options.printRowRange, "print");
|
||||
if(tabulator.options.printFormatter){
|
||||
tabulator.options.printFormatter(tabulator.element, generatedTable);
|
||||
}
|
||||
setHtml(generatedTable.outerHTML);
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<RawHtmlBlock html={html} />
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user