Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/firefly/html/test/tests-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ <h4>use tbl.relatedCols to highlight related rows</h4>
const table2 = { tbl_id: 'table2', tableData: { columns, data } };
const table3 = { tbl_id: 'table3', tableData: { columns, data } };
firefly.showClientTable('single', table1);
firefly.showClientTable('single', table2);
firefly.showClientTable('tabs', table2);
firefly.showClientTable('tabs', table3);
[2,3].forEach(i => {
const {tbl_ui_id} = firefly.util.table.getTableUiByTblId("table"+i);
Expand Down
10 changes: 2 additions & 8 deletions src/firefly/js/tables/ui/TablesContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,17 @@ const logger = Logger('Tables').tag('TablesContainer');

export function TablesContainer(props) {
const {mode='both', closeable=true, tableOptions, style, expandedMode:xMode=false} = props;
let {tbl_group} = props;
const expandedMode = useStoreConnector(() => xMode || getExpandedMode() === LO_VIEW.tables);
const tbl_group = expandedMode && mode !== 'standard' ? TblUtil.getTblExpandedInfo().tbl_group : props.tbl_group;

const tables = useStoreConnector(() => TblUtil.getTableGroup(tbl_group)?.tables);
const active = useStoreConnector(() => TblUtil.getTableGroup(tbl_group)?.active);
const expandedMode = useStoreConnector(() => xMode || getExpandedMode() === LO_VIEW.tables);
useStoreConnector((lastTitles) => {// force a rerender if any title ui changes
const titles= getTblIdsByGroup().map( (tbl_id) => getTableUiByTblId(tbl_id)?.title);
if (!lastTitles) return titles;
return (union(titles,lastTitles).length === titles?.length) ? lastTitles : titles;
});

useEffect(() => {
if (expandedMode && mode !== 'standard') {
tbl_group = TblUtil.getTblExpandedInfo().tbl_group;
}
}, [expandedMode, mode]);

logger.debug('render... tbl_group: ' + tbl_group);

if (expandedMode) {
Expand Down