Results 1 to 4 of 4

Thread: Find the flex width

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    8
    Vote Rating
    2
      0  

    Default Find the flex width

    I am having a page where I have a navigation on the left hand side and an image gallery that displays images in a grid format. The Image grid has a flex equal to 7.

    I need to find the flex width or the width of the page on the right hand side. SO that I need to fill this entire width with the images.

    Please help me in finding the width of the flex. (eg. if flex = 7, what is the flexwidth/width?)

    Appreciate your reply.

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1381
      0  

    Default

    If on item has flex : 7 then it's width is dependent on the value of flex and width of the other items.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

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

  3. #3
    Sencha User
    Join Date
    Nov 2012
    Posts
    8
    Vote Rating
    2
      0  

    Default

    The problem what I am facing exactly is that I need to find the width of the data view item on the right.
    i.e I have a navigation bar on the left and the grid view on the right.
    I give an id: 'ImGrid' for the data view item (Ext.dataview.Dataview). On page load, I am not able to fetch the width using 'Ext.get('ImGrid').getWidth();

    Please let me know if there are any other ways to find the page width in this case

    Thanks in advance.

  4. #4
    Sencha User
    Join Date
    Nov 2012
    Posts
    8
    Vote Rating
    2
      0  

    Default

    I solved this issue

    on the "beforeInitialize" function I used the "painted" event and I was able to get the width.

    beforeInitialize: function(config) {
    this.on('painted', 'onImgPainted', this);
    },
    onImgPainted: function () {
    var screen_width = Ext.get('ImGrid').getWidth();
    this.handleOrientationImgGrid(screen_width);
    },

Posting Permissions

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