首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Sencha ExtReact嵌套对话框不可访问

Sencha ExtReact嵌套对话框不可访问
EN

Stack Overflow用户
提问于 2020-02-29 21:47:31
回答 1查看 111关注 0票数 0

详细信息:如果你看了视频,你能准确地看到问题,第一个对话框工作正常,但不是嵌套对话框,由于某些原因无法访问,任何帮助将是非常感谢的。

显示问题的视频

版本信息:

节点--版本12.16.1 npm - 6.13.4版 “反应”:"^16.13.0“ "_from":“@sencha/ext-react现代@^7.2.0”

如果你还需要什么可以帮助解决这个问题的话,请告诉我。

这是我的代码:

代码语言:javascript
复制
import React, { Component } from 'react';
import { Container, Button } from '@sencha/ext-react-modern';
import { Dialog } from '@sencha/ext-react-modern';

export default class NestedDialogs extends Component {

    state = {
        showGrandfatherDialog: false
    }

    showGrandfatherDialog = () => {
        //debugger;
        this.setState({ showGrandfatherDialog: true });
    }

    destroyGrandfatherDialog = () => {
        //debugger;
        this.setState({ showGrandfatherDialog: false });
    }

    render() {
        const { showGrandfatherDialog } = this.state;

        return (
            <Container
                viewport={true}
                layout={{ type: 'vbox', pack: 'center', align: 'middle'}}
            >
                <Button text="Show Grandfather Dialog" handler={this.showGrandfatherDialog} ui="action raised" />

                {showGrandfatherDialog === true && 
                    <GrandfatherDialog
                        displayed={showGrandfatherDialog}
                        destroy={this.destroyGrandfatherDialog}
                    >
                    </GrandfatherDialog>
                }

            </Container>
        )
    }
}

class GrandfatherDialog extends Component {

    state = {
        showFatherDialog: false
    }

    showFatherDialog = () => {
        //debugger;
        this.setState({ showFatherDialog: true });
    }

    destroyFatherDialog = () => {
        //debugger;
        this.setState({ showFatherDialog: true });
    }

    render() {
        const { showFatherDialog } = this.state;
        return (
            <Dialog
                displayed={this.props.displayed}
                title="Grandfather Dialog"
                closable="true"
                width="600"
                height="600"
                layout={{ type: 'vbox', pack: 'center', align: 'middle'}}
                onDestroy={this.props.destroy}
            >
                <Button text="Show Father Dialog" handler={this.showFatherDialog} ui="action raised" />
                    {showFatherDialog === true &&
                        <FatherDialog
                            displayed={showFatherDialog}
                            destroy={this.destroyFatherDialog}
                        >
                        </FatherDialog>
                    }
            </Dialog>
        );
    }
}

class FatherDialog extends Component {

    render() {
        return (
            <Dialog
                displayed={this.props.displayed}
                title="Father Dialog"
                closable="true"
                width="400"
                height="400"
                onDestroy={this.props.destroy}
            >
            </Dialog>
        );
    }
}
EN

回答 1

Stack Overflow用户

发布于 2020-03-02 13:24:53

您可以为组件zIndex设置Dialog

小提琴

但在这种情况下,面罩不能正常工作。我认为这是因为Dialog不适合多层使用。这个问题在经典工具包中用help Ext.ZIndexManager解决。现代工具箱里没有那个经理吗

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60469898

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档