1. #1
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007
    Location
    Mexico
    Posts
    474
    Vote Rating
    5
    mysticav is on a distinguished road

      0  

    Default How to mimic the maximize function used by Sencha Code Preview on examples

    How to mimic the maximize function used by Sencha Code Preview on examples


    For instance, if you check this:
    http://docs.sencha.com/extjs/4.2.1/#...une/#tree-grid

    You have a Code Preview panel on the east region of a border layout. The interesting thing is that the panel has a maximizable button, a function that is only available in Ext Window Component.

    I would like to implement that functionality in my east region.

    Any idea ?

    Thanks.
    Using Ext with cachefly
    Working on LAMPExt

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,645
    Vote Rating
    583
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      1  

    Default


    All the source is there:

    Code:
        'codePreview tool[type=maximize]': {
            click: 'onMaximizeClick'
        },
    
        onMaximizeClick: function(){
            var preview = this.getCodePreview(),
                code = preview.getEl().down('.prettyprint').dom.innerHTML;
    
            var w = new Ext.window.Window({
                rtl: false,
                baseCls: 'x-panel',
                maximized: true,
                title: 'Code Preview',
                plain: true,
                cls: 'preview-container',
                autoScroll: true,
                bodyStyle: 'background-color:white',
                html: '<pre class="prettyprint">' + code + '</pre>',
                closable: false,
                tools: [{
                    type: 'close',
                    handler: function() {
                        w.hide(preview, function() {
                            w.destroy();
                        });
                    }
                }]
            });
            w.show(preview);
        },
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Brazil, Goias, Goiânia
    Posts
    394
    Vote Rating
    4
    wemerson.januario is on a distinguished road

      0  

    Default


    how to add the CodePreview panel to window maximized instead of the innerHTML?
    Wemerson Januario
    Skype:
    wemerson.januario
    Email: wemerson.januario@gmail.com
    Fone:
    62 84101145 - Goiânia-GO- Brazil
    Consulting and Training Ext JS
    Projects: (Nubes ERP)

Thread Participants: 2