Grid ve Tree için Dinamik Heigth / Custom Button Width
This commit is contained in:
parent
a2a0d46488
commit
4f164f3289
3 changed files with 46 additions and 11 deletions
|
|
@ -249,14 +249,14 @@ div.dialog-after-open > div.dialog-content.maximized {
|
||||||
|
|
||||||
.dx-datagrid-header-panel > .dx-toolbar .dx-toolbar-before,
|
.dx-datagrid-header-panel > .dx-toolbar .dx-toolbar-before,
|
||||||
.dx-treelist-header-panel > .dx-toolbar .dx-toolbar-before {
|
.dx-treelist-header-panel > .dx-toolbar .dx-toolbar-before {
|
||||||
width: 50% !important;
|
width: auto !important;
|
||||||
max-width: 50% !important;
|
max-width: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dx-datagrid-header-panel > .dx-toolbar .dx-toolbar-after,
|
.dx-datagrid-header-panel > .dx-toolbar .dx-toolbar-after,
|
||||||
.dx-treelist-header-panel > .dx-toolbar .dx-toolbar-after {
|
.dx-treelist-header-panel > .dx-toolbar .dx-toolbar-after {
|
||||||
width: 50% !important;
|
width: auto !important;
|
||||||
max-width: 50% !important;
|
max-width: 100% !important;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
|
||||||
|
|
@ -251,6 +251,21 @@ const isTouchLikeDevice = () =>
|
||||||
const isMobileViewport = () =>
|
const isMobileViewport = () =>
|
||||||
typeof window !== 'undefined' && window.matchMedia?.('(max-width: 767px)').matches
|
typeof window !== 'undefined' && window.matchMedia?.('(max-width: 767px)').matches
|
||||||
|
|
||||||
|
const getEditPopupHeight = (useMobileEditPopup: boolean, isPopupFullScreen: boolean) =>
|
||||||
|
useMobileEditPopup && isPopupFullScreen ? '100%' : 'auto'
|
||||||
|
|
||||||
|
const getEditPopupMaxHeight = (
|
||||||
|
useMobileEditPopup: boolean,
|
||||||
|
isPopupFullScreen: boolean,
|
||||||
|
configuredHeight?: number,
|
||||||
|
) => {
|
||||||
|
if (useMobileEditPopup && isPopupFullScreen) {
|
||||||
|
return '100%'
|
||||||
|
}
|
||||||
|
|
||||||
|
return configuredHeight && configuredHeight > 0 ? configuredHeight : '90vh'
|
||||||
|
}
|
||||||
|
|
||||||
const Grid = (props: GridProps) => {
|
const Grid = (props: GridProps) => {
|
||||||
const { listFormCode, searchParams, isSubForm, level, gridDto: extGridDto } = props
|
const { listFormCode, searchParams, isSubForm, level, gridDto: extGridDto } = props
|
||||||
const { translate } = useLocalization()
|
const { translate } = useLocalization()
|
||||||
|
|
@ -1566,10 +1581,12 @@ const Grid = (props: GridProps) => {
|
||||||
width: useMobileEditPopup
|
width: useMobileEditPopup
|
||||||
? '100%'
|
? '100%'
|
||||||
: gridDto.gridOptions.editingOptionDto?.popup?.width,
|
: gridDto.gridOptions.editingOptionDto?.popup?.width,
|
||||||
height:
|
height: getEditPopupHeight(useMobileEditPopup, isPopupFullScreen),
|
||||||
useMobileEditPopup && isPopupFullScreen
|
maxHeight: getEditPopupMaxHeight(
|
||||||
? '100%'
|
useMobileEditPopup,
|
||||||
: gridDto.gridOptions.editingOptionDto?.popup?.height,
|
isPopupFullScreen,
|
||||||
|
gridDto.gridOptions.editingOptionDto?.popup?.height,
|
||||||
|
),
|
||||||
position: useMobileEditPopup
|
position: useMobileEditPopup
|
||||||
? {
|
? {
|
||||||
my: 'top center',
|
my: 'top center',
|
||||||
|
|
|
||||||
|
|
@ -239,6 +239,21 @@ const isTouchLikeDevice = () =>
|
||||||
const isMobileViewport = () =>
|
const isMobileViewport = () =>
|
||||||
typeof window !== 'undefined' && window.matchMedia?.('(max-width: 767px)').matches
|
typeof window !== 'undefined' && window.matchMedia?.('(max-width: 767px)').matches
|
||||||
|
|
||||||
|
const getEditPopupHeight = (useMobileEditPopup: boolean, isPopupFullScreen: boolean) =>
|
||||||
|
useMobileEditPopup && isPopupFullScreen ? '100%' : 'auto'
|
||||||
|
|
||||||
|
const getEditPopupMaxHeight = (
|
||||||
|
useMobileEditPopup: boolean,
|
||||||
|
isPopupFullScreen: boolean,
|
||||||
|
configuredHeight?: number,
|
||||||
|
) => {
|
||||||
|
if (useMobileEditPopup && isPopupFullScreen) {
|
||||||
|
return '100%'
|
||||||
|
}
|
||||||
|
|
||||||
|
return configuredHeight && configuredHeight > 0 ? configuredHeight : '90vh'
|
||||||
|
}
|
||||||
|
|
||||||
const Tree = (props: TreeProps) => {
|
const Tree = (props: TreeProps) => {
|
||||||
const { listFormCode, searchParams, isSubForm, level, gridDto: extGridDto } = props
|
const { listFormCode, searchParams, isSubForm, level, gridDto: extGridDto } = props
|
||||||
const { translate } = useLocalization()
|
const { translate } = useLocalization()
|
||||||
|
|
@ -1220,9 +1235,12 @@ const Tree = (props: TreeProps) => {
|
||||||
width: useMobileEditPopup
|
width: useMobileEditPopup
|
||||||
? '100%'
|
? '100%'
|
||||||
: gridDto.gridOptions.editingOptionDto?.popup?.width,
|
: gridDto.gridOptions.editingOptionDto?.popup?.width,
|
||||||
height: useMobileEditPopup && isPopupFullScreen
|
height: getEditPopupHeight(useMobileEditPopup, isPopupFullScreen),
|
||||||
? '100%'
|
maxHeight: getEditPopupMaxHeight(
|
||||||
: gridDto.gridOptions.editingOptionDto?.popup?.height,
|
useMobileEditPopup,
|
||||||
|
isPopupFullScreen,
|
||||||
|
gridDto.gridOptions.editingOptionDto?.popup?.height,
|
||||||
|
),
|
||||||
position: useMobileEditPopup
|
position: useMobileEditPopup
|
||||||
? {
|
? {
|
||||||
my: 'top center',
|
my: 'top center',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue