1. #1
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007
    Location
    Mexico
    Posts
    522
    Vote Rating
    45
    mysticav will become famous soon enough mysticav will become famous soon enough

      0  

    Default 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.

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,756
    Vote Rating
    774
    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, Goiânia
    Posts
    537
    Vote Rating
    27
    wemerson.januario has a spectacular aura about wemerson.januario has a spectacular aura about

      0  

    Default

    how to add the CodePreview panel to window maximized instead of the innerHTML?
    Wemerson Januario
    Website: http://wemersonjanuario.com.br
    Twitter: https://twitter.com/januariocoder

    Email: wemerson.januario@gmail.com

    From: Goiânia, Brazil
    Ext JS Consulting, Training, Support

Thread Participants: 2