Results 1 to 5 of 5

Thread: ViewPort base class

  1. #1
    Sencha User
    Join Date
    Oct 2013
    Posts
    200
    Answers
    3

    Default Answered: ViewPort base class

    Hi,

    I was just trying to create viewport.js file in my app structure, and i have extended it with a form panel and it was not working.
    after that i have extended it with Ext.container.Viewport class and it worked. I know it inherits all the feature of viewport class,
    But if i have included "autocreateviewport : true" in app.js then it should create viewport.js file automatically (please correct me if i am wrong on this),
    or is it mandatory to extend this class with the Ext.container.viewport ?
    and is it required to keep the name of the class viewport.js ?

    Along with that do we really require to call the constructor of parent class(me.callparent(arguments))
    as i see its working in both the way, any help on this will be appreciated !!

    Please reply

    Thanks,
    Ankit

  2. It depends with what you want. As Jay said, Viewport will render 100% the browser's height and width even as you resize the browser. If you want that automatic handling then use a Viewport with a layout and add your items as your use case dictates.

    As for callParent, if you do not execute callParent, you can break inheritance meaning the superclass' code will not execute which may not behave the way you want.

  3. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Answers
    102

    Default

    viewport auto-renders itself to the document body. The formPanel does not. you're not required to extend viewport, but are encouraged to do so if you want an app that takes 100% of the available screen real estate, etc.

  4. #3
    Sencha User
    Join Date
    Oct 2013
    Posts
    200
    Answers
    3

    Default

    Thanks for the prompt reply !!

    ya thats gud to extend the viewport class, but without extending it will work as u said ?

    As i am not able to run the class independently.

    And please let me know do we require to call me.callParent() for all the classes we define, for eg. i create a class A which is extending a form panel. so if i dont include the parent constructor it should automatically load all the feature of panel class? as i have extended or included that class too in my library.

    Thanks,
    Ankit

  5. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449
    Answers
    3997

    Default

    It depends with what you want. As Jay said, Viewport will render 100% the browser's height and width even as you resize the browser. If you want that automatic handling then use a Viewport with a layout and add your items as your use case dictates.

    As for callParent, if you do not execute callParent, you can break inheritance meaning the superclass' code will not execute which may not behave the way you want.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  6. #5
    Sencha User
    Join Date
    Oct 2013
    Posts
    200
    Answers
    3

    Default

    Thanks for replying !!

Posting Permissions

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