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>();
|
const [ html, setHtml ] = useState<string>();
|
||||||
|
|
||||||
return rowData && (
|
return rowData && (
|
||||||
<div className="table-print-view">
|
<>
|
||||||
{!html ? (
|
<h1>{note.title}</h1>
|
||||||
<Tabulator
|
|
||||||
tabulatorRef={tabulatorRef}
|
<div className="table-print-view">
|
||||||
className="table-print-view-container"
|
|
||||||
modules={[ PrintModule, ExportModule, FormatModule ]}
|
{!html ? (
|
||||||
columns={columnDefs ?? []}
|
<Tabulator
|
||||||
data={rowData}
|
tabulatorRef={tabulatorRef}
|
||||||
index="branchId"
|
className="table-print-view-container"
|
||||||
dataTree={hasChildren}
|
modules={[ PrintModule, ExportModule, FormatModule ]}
|
||||||
printStyled={true}
|
columns={columnDefs ?? []}
|
||||||
onReady={() => {
|
data={rowData}
|
||||||
const tabulator = tabulatorRef.current;
|
index="branchId"
|
||||||
if (!tabulator) return;
|
dataTree={hasChildren}
|
||||||
const generatedTable = tabulator.modules.export.generateTable(tabulator.options.printConfig, tabulator.options.printStyled, tabulator.options.printRowRange, "print");
|
printStyled={true}
|
||||||
if(tabulator.options.printFormatter){
|
onReady={() => {
|
||||||
tabulator.options.printFormatter(tabulator.element, generatedTable);
|
const tabulator = tabulatorRef.current;
|
||||||
}
|
if (!tabulator) return;
|
||||||
setHtml(generatedTable.outerHTML);
|
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);
|
||||||
) : (
|
}
|
||||||
<RawHtmlBlock html={html} className="tabulator-print-fullscreen" />
|
setHtml(generatedTable.outerHTML);
|
||||||
)}
|
}}
|
||||||
</div>
|
/>
|
||||||
|
) : (
|
||||||
|
<RawHtmlBlock html={html} />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user