简体   繁体   English

如何在 Extjs4 中创建下面的图像?

[英]How to create below image in Extjs4?

I want to develop a window in extjs4 which exactly same like below image, so that the user able to see root cause when they click on details section.我想在 extjs4 中开发一个与下图完全相同的窗口,以便用户在单击详细信息部分时能够看到根本原因。 Textarea section should be hide/show when click on details tab.单击详细信息选项卡时,文本区域部分应隐藏/显示。

所需窗口

Ext.create('Ext.window.Window', {
            title: 'First Window',
            height: 200,
            width: 400,  
            layout:'fit',
            items:{
                xtype:'form',
                //title: 'ErrorDetails',
                bodyPadding: 5,
                width: 350,
                items:[{
                    html: 'Failed to submit the request'
                },
                {
                    xtype: 'button'
                    ,text: 'Details>>' ,
                    handler : function(){
                        console.log('Button got clicked');
                    }
                },
                {
                    xtype: 'textarea',
                    id:'tt',
                    minHeight : 300
                    ,minLength : 500
                }]
            }

        }).show();

If your are looking for a functionality to show the text area.This is how it works:如果您正在寻找显示文本区域的功能。这是它的工作原理:

Need to add following code in button handler:需要在按钮处理程序中添加以下代码:

this.up().down('textarea').show();

Need to hide the textarea while creating the window using hidden:true property.需要在使用hidden:true属性创建窗口时隐藏 textarea。

Ext.create('Ext.window.Window', {
            title: 'First Window',
            width: 400,  
            layout:'fit',
            items:{
                xtype:'form',
                //title: 'ErrorDetails',
                bodyPadding: 5,
                width: 350,
                items:[{
                    html: 'Failed to submit the request'
                },
                {
                    xtype: 'button'
                    ,text: 'Details>>' ,
                    handler : function(){
                        this.up().down('textarea').show();
                    }
                },
                {
                    xtype: 'textarea',
                    id: 'tt',
                    hidden:true,
                    readOnly:true,
                    minHeight : 300
                    ,minLength : 500
                }]
            }

        }).show();
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM