Skip to content

Commit

Permalink
fix: totals line count for ios
Browse files Browse the repository at this point in the history
  • Loading branch information
vcellu committed Nov 9, 2022
1 parent 89b7e9a commit c57d0bf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
10 changes: 6 additions & 4 deletions ios/ContainerView.swift
Expand Up @@ -213,11 +213,11 @@ class ContainerView: UIView {
tableViewFactory.create()
firstColumnTable = tableViewFactory.firstColumnTableView
multiColumnTable = tableViewFactory.multiColumnTableView

setNeedsLayout()
DispatchQueue.main.async {
self.horizontalScrollView?.setContentOffset(CGPoint(x: 0, y: 0), animated: false)
self.testTruncation()
self.firstColumnTable?.dataCollectionView?.postSignalVisibleRows()
self.testTruncation()
}
} else {
guard let firstColumnTable = self.firstColumnTable else { return }
Expand Down Expand Up @@ -262,6 +262,7 @@ class ContainerView: UIView {
multiColumnTable?.updateGrabbers(height)
firstHeader.layoutIfNeeded()
multiHeader.layoutIfNeeded()
layoutIfNeeded()
}
testTotals()
}
Expand All @@ -276,11 +277,12 @@ class ContainerView: UIView {
// uses cellcontent style for style, but header.wrap for checking wrap
if lineCount != maxTotalsLineCount {
maxTotalsLineCount = lineCount
let height = Double(maxHeaderLineCount) * (cellStyle?.lineHeight ?? 1.0)
let height = Double(maxTotalsLineCount) * (cellStyle?.lineHeight ?? 1.0)
firstTotal.dynamicHeight.constant = height + (PaddedLabel.PaddingSize * 2.0)
multiTotal.dynamicHeight.constant = height + (PaddedLabel.PaddingSize * 2.0)
firstTotal.layoutIfNeeded()
multiTotal.layoutIfNeeded()
layoutIfNeeded()
}
}

Expand All @@ -294,7 +296,7 @@ class ContainerView: UIView {
maxCollectionViewsLineCount = lineCount
first.setMaxLineCount(maxCollectionViewsLineCount)
multi.setMaxLineCount(maxCollectionViewsLineCount)

layoutIfNeeded()
}
}

Expand Down
29 changes: 18 additions & 11 deletions src/components/SimpleGrid.tsx
Expand Up @@ -110,18 +110,25 @@ const SimpleGrid: React.FC<SimpleGridProps> = ({
[expandCell]
);

const signalSearch = useCallback(async (column: any) => {
try {
const props = await model.getEffectiveProperties();

if( props?.qHyperCubeDef?.qDimensions[column.dataColIdx].qDef.qFieldDefs[0] ) {
column.label = props?.qHyperCubeDef?.qDimensions[column.dataColIdx].qDef.qFieldDefs[0];
}
searchColumn({searching: true, column})
} catch (error) {
const signalSearch = useCallback(
async (column: any) => {
try {
const props = await model.getEffectiveProperties();

}
}, [searchColumn])
if (
props?.qHyperCubeDef?.qDimensions[column.dataColIdx].qDef
.qFieldDefs[0]
) {
column.label =
props?.qHyperCubeDef?.qDimensions[
column.dataColIdx
].qDef.qFieldDefs[0];
}
searchColumn({ searching: true, column });
} catch (error) {}
},
[model, searchColumn]
);

const onSearchColumn = useCallback(
(event: any) => {
Expand Down

0 comments on commit c57d0bf

Please sign in to comment.