form view filters

This commit is contained in:
Jan Prochazka
2021-01-14 17:43:35 +01:00
parent cac85d776a
commit 26b1c69f12
6 changed files with 123 additions and 4 deletions

View File

@@ -157,7 +157,14 @@ export default function FormView(props) {
showMenu(
event.pageX,
event.pageY,
<FormViewContextMenu switchToTable={handleSwitchToTable} onNavigate={onNavigate} />
<FormViewContextMenu
switchToTable={handleSwitchToTable}
onNavigate={onNavigate}
addToFilter={() => formDisplay.addFilterColumn(getCellColumn(currentCell))}
filterThisValue={
isDataCell(currentCell) ? () => formDisplay.filterCellValue(getCellColumn(currentCell), rowData) : null
}
/>
);
};
@@ -394,7 +401,7 @@ export default function FormView(props) {
};
const rowCountInfo = React.useMemo(() => {
if (rowData == null) return 'No data';
if (rowData == null) return 'No data';
if (allRowCount == null || rowCountBefore == null) return 'Loading row count...';
return `Row: ${(rowCountBefore + 1).toLocaleString()} / ${allRowCount.toLocaleString()}`;
}, [rowCountBefore, allRowCount]);