1. #1
    Sencha User
    Join Date
    Mar 2008
    Posts
    21
    Vote Rating
    0
    bjt is on a distinguished road

      0  

    Default print content of a tab panel

    Hi,

    how can i print the content of a tab panel that has a autoLoad parameter?
    I think with the option iframe it is possible?
    the print button can point to the iframe document.iframe_name.print();
    but i dont know how to do this

    please help

    Is there an other solution?

    this is my window with the tab panels and a print button.
    i will print the content of the selected tab

    ps: sorry for my english. im german

    HTML Code:
    Ext.onReady(function(){
     
        var button = Ext.get('cv_button');
        button.on('click', function(){
            // tabs for the center
            var tabs = new Ext.TabPanel({
                region: 'center',
                margins:'3 3 3 0', 
                activeTab: 0,
                defaults:{autoScroll:true},
                items:[{
                    title: '<?=lang_input_changer_field_ger;?>',
                    autoLoad:'/view_cv.php?id_lang=1'
                },{
                    title: '<?=lang_input_changer_field_en;?>',
                    autoLoad:'/view_cv.php?id_lang=2'
                }]
            });
     
            // Panel for the west
            var nav = new Ext.Panel({
                title: 'Optionen',
                region: 'south',
                height: 48,
                items:[
                 new Ext.Button({
               id: 'print_btn',
               text: 'print',
               iconCls: 'sdgsadg',
               icon: '/img/printer.gif',
            handler: function(){
                       window.print();
                   }
             })
             ]
            });
     
            var win = new Ext.Window({
                title: '<?=user_menu_9;?>',
                closable:true,
                width:860,
                height:600,
                //border:false,
                plain:true,
                layout: 'border',
                modal:true,
                items: [nav,tabs],
                buttons: [{
                   text: '<?=image_upload_14;?>',
                   handler: function(){
                       win.hide();
                   }
               }]
            });
            win.show(this);
        });
    });

  2. #2
    Sencha - Services Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,965
    Vote Rating
    12
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default

    With ux.ManagedIframePanel, you could do this:

    Code:
    var tabs = new Ext.TabPanel({
                region: 'center',
                margins:'3 3 3 0', 
                activeTab: 0,
                defaults:{autoScroll:true},
                items:[{
                    xtype: 'iframepanel',
                    id: 'frame1',
                    title: '<?=lang_input_changer_field_ger;?>',
                    defaultSrc :'/view_cv.php?id_lang=1'
                },{
                    xtype: 'iframepanel',
                    id: 'frame2',
                    title: '<?=lang_input_changer_field_en;?>',
                    defaultSrc :'/view_cv.php?id_lang=2'
                }] .....
    To print:

    Ext.getCmp('frame1').getFrame().print();
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  3. #3
    Sencha Premium Member
    Join Date
    Dec 2010
    Posts
    12
    Vote Rating
    0
    sinclas is on a distinguished road

      0  

    Default ux.ManagedIframePanel / iFRAMEa TAB Printing

    I see references to ux.ManagedIframePanel all the time when dealing with iFRAMES in TABS. I need to print the contents of the iframe in a TAB. Is this ux.ManagedIframePanel something I should be using? If so, should I be using it with EXT JS 4.0?

    I currently populate the tab with:
    html: '<iframe src=' + record.raw.uri + ' frameborder="0" scrolling="auto" id="frm1" name="frm" width="100%" height="100%"></iframe>'

    Where the record.raw.uri is the URL of the target.



    Thanks!

    Steve



Thread Participants: 2