make table 100% height
This commit is contained in:
parent
c216030c8a
commit
2054df1103
|
@ -15,6 +15,7 @@ import moment from "moment";
|
||||||
|
|
||||||
import {useTranslation} from "react-i18next";
|
import {useTranslation} from "react-i18next";
|
||||||
import {resources} from '../../i18n/config';
|
import {resources} from '../../i18n/config';
|
||||||
|
import {Box} from "@mui/material";
|
||||||
|
|
||||||
global.moment = moment
|
global.moment = moment
|
||||||
|
|
||||||
|
@ -32,7 +33,8 @@ const makeColumnDefinition = (data: any ) => Object.keys(data)
|
||||||
.map(k => ({
|
.map(k => ({
|
||||||
name: k,
|
name: k,
|
||||||
header: k.replace(/_/g, ' '),
|
header: k.replace(/_/g, ' '),
|
||||||
type: typeof data[k]}))
|
type: typeof data[k]
|
||||||
|
}))
|
||||||
|
|
||||||
const columnsRaw: ColumnRaw[] = [
|
const columnsRaw: ColumnRaw[] = [
|
||||||
{
|
{
|
||||||
|
@ -180,7 +182,10 @@ const HostOfferLookupTable = ({ data }: HostOfferLookupTableProps) => {
|
||||||
const reactdatagridi18n = resources[language]?.translation?.reactdatagrid
|
const reactdatagridi18n = resources[language]?.translation?.reactdatagrid
|
||||||
|
|
||||||
|
|
||||||
return <>
|
return <Box sx={{display: 'flex', alignItems: 'stretch', flexDirection: 'column', minHeight: '100%'}}>
|
||||||
|
<div
|
||||||
|
style={{flex: '1 1', height: '100%'}}
|
||||||
|
>
|
||||||
<DataGrid
|
<DataGrid
|
||||||
idProperty="id"
|
idProperty="id"
|
||||||
filterable
|
filterable
|
||||||
|
@ -192,10 +197,11 @@ const HostOfferLookupTable = ({ data }: HostOfferLookupTableProps) => {
|
||||||
enableColumnAutosize={false}
|
enableColumnAutosize={false}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={dataSource}
|
dataSource={dataSource}
|
||||||
style={{minHeight: '1000px'}}
|
|
||||||
i18n={reactdatagridi18n || undefined}
|
i18n={reactdatagridi18n || undefined}
|
||||||
|
style={{flex: '1 1', height: '100%'}}
|
||||||
/>
|
/>
|
||||||
</>
|
</div>
|
||||||
|
</Box>
|
||||||
}
|
}
|
||||||
|
|
||||||
export default HostOfferLookupTable
|
export default HostOfferLookupTable
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.main {
|
.main {
|
||||||
|
max-height: 100vh;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
padding: 4rem 4rem;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@ body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
|
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
|
||||||
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
|
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
|
||||||
|
min-height: 100vh;
|
||||||
|
max-height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user