首页 \ 问答 \ 如何将工具栏添加到使用ExtJS的区域(How do I add a toolbar to a region with ExtJS)

如何将工具栏添加到使用ExtJS的区域(How do I add a toolbar to a region with ExtJS)

我在ExtJS中有一个边界布局,

北部地区包含一些HTML,但也需要包含这样的工具栏...

所以我设法设置了边界布局,将html添加到了布局的北部区域,但是我找不到如何实现工具栏的可行示例。

我已经发现了许多自己的工具栏的例子,但我没有充分享受这些奢侈品或者彻底学习ExtJs,所以这对我来说都是希腊化的。

我怀疑有一种方法可以在繁琐的JSON风格的流程之外定义一个工具栏来创建布局,并以某种方式将它附加到该区域,我希望它相对简单。 如果有人能解释我会如何做到这一点,那真的会有所帮助。

这是迄今为止的代码...

//make sure YOUR path is correct to this image!!
Ext.BLANK_IMAGE_URL = '../../ext-2.0.2/resources/images/default/s.gif';


//this runs on DOM load - you can access all the good stuff now.

Ext.onReady(function(){
    var viewport = new Ext.Viewport({
        layout: "border",
        border: false,
        renderTo: Ext.getBody(),
        items: [


        // ------------------------------------------------------------------
        {
            region: "north",
            id : "toolbar-area",
            xtype: 'panel',
            html: [ "<div id=\"html-header\">",
                    "<div id=\"council-logo\"></div>",
                    "<ul id=\"ancillary-menu\">",
                        "<li><a href=\"#\">Logout</a></li>",
                        "<li><a href=\"#\">Gazeteer Home</a></li>",
                        "<li>Hello Rachel</li>",
                    "</ul>",
                    "<img id=\"inteligent-logo\" src=\"applied-images/logos/inteligent.gif\">",
                    "</div>" ],

            /* ++++++++++++++++++++++++++++++++++++++++++++ */
            /* The toolbar needs to go around here....      */
            /* ++++++++++++++++++++++++++++++++++++++++++++ */

            height: 100
        },

        // ------------------------------------------------------------------
        // WEST
        // ------------------------------------------------------------------
        {
            region: 'west',
            xtype: 'panel',
            split: true,
            resizeable: false,
            maxWidth : 350,
            minWidth : 349,
            collapsible: true,
            title: 'Gazetteer Explorer',
            width: 350,
            minSize: 150,

            // --------------------------------------------------------------

            title: 'Nested Layout',
            layout: 'border',
            border: false,
            id: "west",
            items: [

                {
                    // ***********************************************
                    // Search Form
                    // ***********************************************

                    region : "north",
                    height: 300,
                    split : true,
                    id : "left-form-panel",
                    items : [{

                        xtype : "form",
                        id : "search-form",
                        items : [

                            // Authority combo box
                            // ===============================
                            {
                                xtype : "combo",
                                fieldLabel : "Authority",
                                name : "authority",
                                hiddenName : "authority",
                                id : "authority-combo"
                            },
                            // ===============================

                            // Search Fieldset
                            // ===============================
                            {
                                xtype : "fieldset",
                                autoHeight : true,
                                title : "Search by...",
                                id : "search-fieldset",
                                items : [

                                    // Ref Number text Box
                                    // %%%%%%%%%%%%%%%%
                                    {

                                        xtype : "textfield",
                                        name : "ref-number",
                                        fieldLabel : "Ref. Number",
                                        id : "ref-number-textfield"

                                    },
                                    // %%%%%%%%%%%%%%%%
                                    // Streetname Combo
                                    // %%%%%%%%%%%%%%%
                                    {

                                        xtype : "combo",
                                        name : "street-name",
                                        hiddenName : "street-name",
                                        fieldLabel : "Street Name",
                                        id : "street-name-combo"

                                    },
                                    // %%%%%%%%%%%%%%%%
                                    // Postcode Combo
                                    // %%%%%%%%%%%%%%%%
                                    {

                                        xtype : "combo",
                                        name : "postcode",
                                        hiddenName : "postcode",
                                        fieldLabel : "Postcode",
                                        id : "postcode-combo"

                                    },
                                    // %%%%%%%%%%%%%%%%

                                    // Postcode Combo
                                    // %%%%%%%%%%%%%%%%
                                    {

                                        xtype : "combo",
                                        name : "town",
                                        hiddenName : "town",
                                        fieldLabel : "Town",
                                        id : "towm-combo"

                                    },
                                    // %%%%%%%%%%%%%%%%

                                    // Postcode Combo
                                    // %%%%%%%%%%%%%%%%
                                    {

                                        xtype : "combo",
                                        name : "locality",
                                        hiddenName : "locality",
                                        fieldLabel : "Locality",
                                        id : "locality-combo"

                                    },
                                    // %%%%%%%%%%%%%%%

                                     // Search Button
                                    // %%%%%%%%%%%%%%%%

                                    {
                                        xtype : "button",
                                        text : "Search",
                                        id : "search-button"
                                    },  

                                    // Reset Button
                                    // %%%%%%%%%%%%%%%

                                    {
                                        xtype : "button",
                                        text : "Reset",
                                        id : "reset-button"
                                    } 


                                ]
                            },
                            // =======================


                        ]

                    }]

                    // *********************************************

                },

                {
                    region: 'center',
                    html: 'Tree view goes here'
                }

            ]



        },

        // ------------------------------------------------------------------
        {
            region: 'center',
            xtype: 'panel',


            // --------------------------------------------------------------
              layout: 'border',
              border: false,
              items: [

                  {
                    region: 'center',
                    height: 200,
                    split: true,
                    html: 'Map goes here'
                  },

                  {
                    region: 'south',
                    title: "Selection", 
                    split: true,
                    height: 200,
                    collapsible: true,
                    html: 'Nested Center'
                  }

              ]
        },

        // ------------------------------------------------------------------
        {
            region: 'east',

        },

        // ------------------------------------------------------------------

        {
            region: 'south',
        }]


    }); 
});

对不起有很多代码,但ExtJS让我害怕碰触任何可以工作的东西。


I have a border layout in ExtJS,

The north region contains some HTML, but also needs to contain a toolbar like this...

So i've managed to get the border layout set up, added the html to the North Region of the layout, but I can't find any workable examples of how to implement a tool bar.

I have found lot's of examples of toolbars on their own, but I've not got the luxury or learning ExtJs thoroughly so it's all greek to me.

I suspect there's a way to define a tool bar outside of the cumbersome JSON style flow of creating a layout and somehow attaching it to the region, and I'm hoping it's relativley simple to do. If someone can explain how I'd do this, it would really help.

Here's the code so far...

//make sure YOUR path is correct to this image!!
Ext.BLANK_IMAGE_URL = '../../ext-2.0.2/resources/images/default/s.gif';


//this runs on DOM load - you can access all the good stuff now.

Ext.onReady(function(){
    var viewport = new Ext.Viewport({
        layout: "border",
        border: false,
        renderTo: Ext.getBody(),
        items: [


        // ------------------------------------------------------------------
        {
            region: "north",
            id : "toolbar-area",
            xtype: 'panel',
            html: [ "<div id=\"html-header\">",
                    "<div id=\"council-logo\"></div>",
                    "<ul id=\"ancillary-menu\">",
                        "<li><a href=\"#\">Logout</a></li>",
                        "<li><a href=\"#\">Gazeteer Home</a></li>",
                        "<li>Hello Rachel</li>",
                    "</ul>",
                    "<img id=\"inteligent-logo\" src=\"applied-images/logos/inteligent.gif\">",
                    "</div>" ],

            /* ++++++++++++++++++++++++++++++++++++++++++++ */
            /* The toolbar needs to go around here....      */
            /* ++++++++++++++++++++++++++++++++++++++++++++ */

            height: 100
        },

        // ------------------------------------------------------------------
        // WEST
        // ------------------------------------------------------------------
        {
            region: 'west',
            xtype: 'panel',
            split: true,
            resizeable: false,
            maxWidth : 350,
            minWidth : 349,
            collapsible: true,
            title: 'Gazetteer Explorer',
            width: 350,
            minSize: 150,

            // --------------------------------------------------------------

            title: 'Nested Layout',
            layout: 'border',
            border: false,
            id: "west",
            items: [

                {
                    // ***********************************************
                    // Search Form
                    // ***********************************************

                    region : "north",
                    height: 300,
                    split : true,
                    id : "left-form-panel",
                    items : [{

                        xtype : "form",
                        id : "search-form",
                        items : [

                            // Authority combo box
                            // ===============================
                            {
                                xtype : "combo",
                                fieldLabel : "Authority",
                                name : "authority",
                                hiddenName : "authority",
                                id : "authority-combo"
                            },
                            // ===============================

                            // Search Fieldset
                            // ===============================
                            {
                                xtype : "fieldset",
                                autoHeight : true,
                                title : "Search by...",
                                id : "search-fieldset",
                                items : [

                                    // Ref Number text Box
                                    // %%%%%%%%%%%%%%%%
                                    {

                                        xtype : "textfield",
                                        name : "ref-number",
                                        fieldLabel : "Ref. Number",
                                        id : "ref-number-textfield"

                                    },
                                    // %%%%%%%%%%%%%%%%
                                    // Streetname Combo
                                    // %%%%%%%%%%%%%%%
                                    {

                                        xtype : "combo",
                                        name : "street-name",
                                        hiddenName : "street-name",
                                        fieldLabel : "Street Name",
                                        id : "street-name-combo"

                                    },
                                    // %%%%%%%%%%%%%%%%
                                    // Postcode Combo
                                    // %%%%%%%%%%%%%%%%
                                    {

                                        xtype : "combo",
                                        name : "postcode",
                                        hiddenName : "postcode",
                                        fieldLabel : "Postcode",
                                        id : "postcode-combo"

                                    },
                                    // %%%%%%%%%%%%%%%%

                                    // Postcode Combo
                                    // %%%%%%%%%%%%%%%%
                                    {

                                        xtype : "combo",
                                        name : "town",
                                        hiddenName : "town",
                                        fieldLabel : "Town",
                                        id : "towm-combo"

                                    },
                                    // %%%%%%%%%%%%%%%%

                                    // Postcode Combo
                                    // %%%%%%%%%%%%%%%%
                                    {

                                        xtype : "combo",
                                        name : "locality",
                                        hiddenName : "locality",
                                        fieldLabel : "Locality",
                                        id : "locality-combo"

                                    },
                                    // %%%%%%%%%%%%%%%

                                     // Search Button
                                    // %%%%%%%%%%%%%%%%

                                    {
                                        xtype : "button",
                                        text : "Search",
                                        id : "search-button"
                                    },  

                                    // Reset Button
                                    // %%%%%%%%%%%%%%%

                                    {
                                        xtype : "button",
                                        text : "Reset",
                                        id : "reset-button"
                                    } 


                                ]
                            },
                            // =======================


                        ]

                    }]

                    // *********************************************

                },

                {
                    region: 'center',
                    html: 'Tree view goes here'
                }

            ]



        },

        // ------------------------------------------------------------------
        {
            region: 'center',
            xtype: 'panel',


            // --------------------------------------------------------------
              layout: 'border',
              border: false,
              items: [

                  {
                    region: 'center',
                    height: 200,
                    split: true,
                    html: 'Map goes here'
                  },

                  {
                    region: 'south',
                    title: "Selection", 
                    split: true,
                    height: 200,
                    collapsible: true,
                    html: 'Nested Center'
                  }

              ]
        },

        // ------------------------------------------------------------------
        {
            region: 'east',

        },

        // ------------------------------------------------------------------

        {
            region: 'south',
        }]


    }); 
});

Sorry there's so much code, but ExtJS makes me scared to touch anything that's working.


原文:https://stackoverflow.com/questions/2506711
更新时间:2023-04-25 22:04

最满意答案

不幸的是 - 它可能是很多事情 - 许多应用程序服务器和其他java包装容易发挥属性和他们自己的“钥匙串”,而不是。 所以它可能在看完全不同的东西。

没有桁架 - 我会尝试:

java -Djavax.net.debug=all -Djavax.net.ssl.trustStore=trustStore ...

看看是否有帮助。 而不是“全部”,也可以将其设置为“ssl”,密钥管理器和信任管理器,这可能有助于您的处理。 将其设置为“帮助”将在大多数平台上列出如下所示的内容。

无论如何 - 确保您完全了解密钥库(您拥有私钥和证书,证明您自己的身份)与信任存储(确定您信任的人)之间的区别 - 以及您自己的身份对根有一个“连锁”的信任 - 这与任何一个链条分开,你需要找出你信任的“谁”。

all            turn on all debugging
ssl            turn on ssl debugging

The   following can be used with ssl:
    record       enable per-record tracing
    handshake    print each handshake message
    keygen       print key generation data
    session      print session activity
    defaultctx   print default SSL initialization
    sslctx       print SSLContext tracing
    sessioncache print session cache tracing
    keymanager   print key manager tracing
    trustmanager print trust manager tracing
    pluggability print pluggability tracing

    handshake debugging can be widened with:
    data         hex dump of each handshake message
    verbose      verbose handshake message printing

    record debugging can be widened with:
    plaintext    hex dump of record plaintext
    packet       print raw SSL/TLS packets

资料来源:#请参阅http://download.oracle.com/javase/1.5.0/docs/guide/security/jsse/JSSERefGuide.html#Debug


Unfortunately - it could be many things - and lots of app servers and other java 'wrappers' are prone to play with properties and their 'own' take on keychains and what not. So it may be looking at something totally different.

Short of truss-ing - I'd try:

java -Djavax.net.debug=all -Djavax.net.ssl.trustStore=trustStore ...

to see if that helps. Instead of 'all' one can also set it to 'ssl', key manager and trust manager - which may help in your case. Setting it to 'help' will list something like below on most platforms.

Regardless - do make sure you fully understand the difference between the keystore (in which you have the private key and cert you prove your own identity with) and the trust store (which determines who you trust) - and the fact that your own identity also has a 'chain' of trust to the root - which is separate from any chain to a root you need to figure out 'who' you trust.

all            turn on all debugging
ssl            turn on ssl debugging

The   following can be used with ssl:
    record       enable per-record tracing
    handshake    print each handshake message
    keygen       print key generation data
    session      print session activity
    defaultctx   print default SSL initialization
    sslctx       print SSLContext tracing
    sessioncache print session cache tracing
    keymanager   print key manager tracing
    trustmanager print trust manager tracing
    pluggability print pluggability tracing

    handshake debugging can be widened with:
    data         hex dump of each handshake message
    verbose      verbose handshake message printing

    record debugging can be widened with:
    plaintext    hex dump of record plaintext
    packet       print raw SSL/TLS packets

Source: # See http://download.oracle.com/javase/1.5.0/docs/guide/security/jsse/JSSERefGuide.html#Debug

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)