-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FlatUiTable component potential improvements #1270
Comments
InvestigationI have reviewed Cesar's feedback and discovered that the following options are available:
While FlatUI tables have limited options, a few features might still be useful:
cc @olayway |
Investigation Summary: Configuring Sorting in FlatUITable ComponentOverviewThe Sorting ConfigurationDefault Sorting BehaviorThe Configuring Sorting by a Different ColumnThe
Example Configuration: <Grid
data={data}
defaultSort={['age', 'desc']} // Sorts by 'age' column in descending order initially
/> Example Configuration (all props): const data = [
{ id: 1, name: 'John Doe', age: 28, occupation: 'Engineer' },
{ id: 2, name: 'Jane Smith', age: 32, occupation: 'Designer' },
{ id: 3, name: 'Mike Johnson', age: 45, occupation: 'Manager' },
]
const defaultFilters = {
age: [10], // Filter rows where age is 10 or more
};
const defaultSort = ['name', 'asc'];
<Grid
data={data}
defaultFilters={defaultFilters}
defaultSort={defaultSort}
defaultStickyColumnName='name' // choose any column that needed to appear first in the table
canDownload={true}
downloadFilename='my-data'
isEditable={true}
/> Example changes could be applied to the FlatUITable.tsx component: export interface FlatUiTableProps {
url?: string;
data?: { [key: string]: number | string }[];
rawCsv?: string;
range?: string;
corsProxy?: string;
defaultFilters?: object; // Add additional props here
defaultSort?: [string, 'asc' | 'desc']; // Example additional prop
defaultStickyColumnName?: string; // Example additional prop
canDownload?: boolean; // Example additional prop
downloadFilename?: string; // Example additional prop
isEditable?: boolean; // Example additional prop
// Add more props as needed
} cc @olayway |
Tasks
Notes
From César's feedback on using DataHub Cloud:
The text was updated successfully, but these errors were encountered: