refactor(views/table): use slightly more performant formatter for row number

This commit is contained in:
Elian Doran 2025-07-14 11:30:46 +03:00
parent 8d29c5fe1b
commit 28f4aea3d5
No known key found for this signature in database
2 changed files with 10 additions and 8 deletions

View File

@ -51,7 +51,7 @@ export function buildColumnDefinitions(info: AttributeDefinitionInformation[], m
resizable: false,
frozen: true,
rowHandle: movableRows,
formatter: RowNumberFormatter
formatter: RowNumberFormatter(movableRows)
},
{
field: "noteId",

View File

@ -36,13 +36,15 @@ export function NoteTitleFormatter(cell: CellComponent) {
return $noteRef[0].outerHTML;
}
export function RowNumberFormatter(cell: CellComponent) {
let html = "";
if (cell.getColumn().getDefinition().rowHandle) {
html += `<span class="bx bx-dots-vertical-rounded"></span> `;
}
html += cell.getRow().getPosition(true);
return html;
export function RowNumberFormatter(draggableRows: boolean) {
return (cell: CellComponent) => {
let html = "";
if (draggableRows) {
html += `<span class="bx bx-dots-vertical-rounded"></span> `;
}
html += cell.getRow().getPosition(true);
return html;
};
}
function buildNoteLink(noteId: string) {