Results 1 to 6 of 6

Thread: renderTo and applyTo

  1. #1
    Ext User ives's Avatar
    Join Date
    Sep 2008
    Posts
    13
    Vote Rating
    0
      0  

    Question renderTo and applyTo

    dear
    I am new to ext, I don't understand the difference between "renderTo", "applyTo" and "contentEl", the three config value, can use the node of dom, how situation for me to use it?

    best regards
    ives

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,854
    Vote Rating
    88
      0  

    Default

    • renderTo renders the Component into the specified existing element.
    • applyTo uses the specified alement as the main elementof the Component. A Component created using applyTo does not need rendering - its main element already exists.
    • contentEl is only for Panels. It simply moves the specified element into the body of the Panel when the Panel is rendered to use... as the content!
    Longtime Sencha engineer. Now surplus to requirements apparently...

  3. #3
    Sencha User
    Join Date
    Sep 2010
    Posts
    3
    Vote Rating
    0
      0  

    Default

    i added the config "renderTo: Ext.get('tree-div')" and it just does not work. tree-div is the id of a div in a form in body of the page.
    I am mixed up!
    help me please.

  4. #4
    Sencha User
    Join Date
    Dec 2010
    Posts
    126
    Vote Rating
    0
      0  

    Default

    use Ext.Element.get('tree-div')

  5. #5
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    128
      0  

    Default

    Is this the body of a FormPanel? In that case you shouldn't be using renderTo at all!!!

    Instead, you should be specifying the component as one of the items of the formpanel.

  6. #6
    Sencha User
    Join Date
    Jun 2012
    Posts
    4
    Vote Rating
    0
      0  

    Default how do we render an image displayed in a panel to a printer?

    partial code below

    var ImagePanel = new Ext.Panel({
    id: 'images-view',
    frame: true,
    width: 500,
    height: 1000,

    autoHeight: false,
    layout: 'auto',
    align: 'middle',
    title: 'View image',
    bodyStyle:'overflow:visible',
    bodyCfg:
    {
    tag: 'div',
    cls: 'x-print-body' // Default class not applied if Custom element specified
    },
    bwrapCfg:
    {
    tag: 'div',
    cls: 'x-print-bwrap' // Default class not applied if Custom element specified
    },
    items: [tbUsers,pagingbar,datav]

    })

    // create window
    var win = new Ext.Window({
    id:'imginform-win'
    ,width: 640
    , cls: 'printer'
    ,height: 600
    ,modal: true
    ,layout:'fit'
    ,border:false
    ,closable:true
    ,renderTo:imagepop
    ,frame:true
    ,items:ImagePanel
    });


    //ImagePanel.render('imagepop');


    win.show();

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •