Results 1 to 5 of 5

Thread: Updating Portal to 4.0 with Viewport Override

  1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    4
    Vote Rating
    0
      0  

    Default Updating Portal to 4.0 with Viewport Override

    I am working on application that previously utilized the portal aspect of the ExtJS. I found this set of code that worked for ExtJS 3 (Provided in another ExtJS Forum a year or so ago):
    Code:
    Ext.override(Ext.container.Viewport, {
        initComponent : function() {
            Ext.container.Viewport.superclass.initComponent.call(this);
            this.el = Ext.get(this.el) || Ext.getBody();
            if (this.el.dom === document.body) {
                this.el.dom.parentNode.className += ' x-viewport';
            }
            this.el.setHeight = Ext.emptyFn;
            this.el.setWidth = Ext.emptyFn;
            this.el.setSize = Ext.emptyFn;
            this.el.dom.scroll = 'no';
            this.allowDomMove = false;
            this.autoWidth = true;
            this.autoHeight = true;
            Ext.EventManager.onWindowResize(this.fireResize, this);
            this.renderTo = this.el;
        }
    });
    And as for the Portal/Viewport Setup:
    Code:
    Ext.onReady(function(){
        Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
    
        var viewport = new Ext.Viewport({
            el: "PaulsPortal",
            layout: 'anchor',
            items:[{
                xtype:'portal',
    ....................
    Can someone help with the equivalent for ExtJS 4? I would like to use the draw function in the portlets can cant seem to have the two version interact efficiently.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

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

    Default

    I know it uses Viewport, and so does my old version. I just override the way it renders to the page.

    Is there a way to render a Viewport to a DIV specifically with ExtJS4 versus the entire page like it does by default?

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    Yeah, use a Container instead.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  5. #5
    Sencha User
    Join Date
    Mar 2010
    Posts
    4
    Vote Rating
    0
      0  

    Default

    I am a noob to ExtJS and with javascript in general. Can you provide an example using the ExtJS 4 source?

Similar Threads

  1. portal (Viewport) in ajax tab
    By nuno.s in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 14 Dec 2009, 10:18 AM
  2. ViewPort, Portal & Single Scrollbar
    By LovingIt in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 27 Aug 2008, 7:18 AM
  3. [Ext 2.1] Portal + viewport : JS error in IE after reload
    By milou in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 15 Jul 2008, 11:41 PM
  4. portal example in a panel (not viewport)?
    By aktxyz in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 2 Jan 2008, 3:59 AM

Posting Permissions

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