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

      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
    17,163
    Vote Rating
    674
    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
    472
    Vote Rating
    12
    wemerson.januario will become famous soon enough

      0  

    Default


    how to add the CodePreview panel to window maximized instead of the innerHTML?
    Wemerson Januario
    Twitter:
    @januariocoder
    Email: wemerson.januario@gmail.com

    From: Goiânia, Brazil
    Ext JS Developer

Thread Participants: 2