Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jul 2014
    Posts
    1
    Vote Rating
    0
    sushantpat is on a distinguished road

      0  

    Default show/hide issue with grid columns

    show/hide issue with grid columns


    I am using Ext js 4.2.0 for the development. I am facing issue with width of columns in grid. When I hide any column in the grid and before rendering that grid if I unhide that column using column.show() or setVisible(true) method (this can be achieved by tabs). It disturbs the width of all columns. I tried to debug the issue and I found that issue is in the show method. I have taken this code from Ext.grid.column.Column class. If you see the code of show method
    Code:
     myWidth = Math.min(myWidth * (oldLen / len), defaultWidth, Math.max(availFlex - (len * defaultWidth), defaultWidth));
     me.width = null;
     me.flex = myWidth;
     availFlex -= myWidth;
    when view is not ready for the grid columns and flex is used then width of other columns are zero. So after above calculation for given column, suddenly flex gets increased from 1 to possible viewport width of that grid. and flex for other columns remains same which was given earlier. We do lot of hiding and showing columns in grid based on user selection. What is right solution for this?
    Last edited by Gary Schlosberg; 1 Aug 2014 at 7:42 AM. Reason: jsbeautify code

  2. #2
    Sencha - Support Team
    Join Date
    Feb 2013
    Location
    California
    Posts
    4,073
    Vote Rating
    69
    Gary Schlosberg has a spectacular aura about Gary Schlosberg has a spectacular aura about Gary Schlosberg has a spectacular aura about

      0  

    Default


    Haven't seen this happen before. Can you please post a test case which exhibits this behavior?
    https://fiddle.sencha.com/#home

    Does it occur in more recent versions of ExtJS?


    Are you a Sencha products veteran who has wondered what it might be like to work at Sencha? If so, please reach out to our recruiting manager:
    sheryl@sencha.com

Thread Participants: 1