1. #1
    Sencha User
    Join Date
    Jun 2011
    Location
    Bangalore, India
    Posts
    176
    Answers
    4
    Vote Rating
    2
    renganathan is on a distinguished road

      0  

    Default Unanswered: Grid column width as autofit

    Unanswered: Grid column width as autofit


    Hi all,

    i want to do auto fit for all column based on the content without using
    Code:
    Forcefit: true;
    Guys please help me to fix this problem

    Here is my code
    Code:
    
    // view port
       var vport = new Ext.Viewport(
    {
           layout : 'border',
           items  : 
    [
    { 
    height : 70,
    // autoWidth   : true,
                   region : 'north',
    border : true,
    items :
    [
    { 
    xtype : 'box',
    width : '18%',
    autoEl : {tag: 'img', src:'./ciscologo.png'}
    },
    { 
    xtype : 'panel',
    // autoWidth : true,
    items   : 
    [
    { 
    xtype : 'button', 
    text : 'Button 1'
    },
    { 
    xtype : 'button', 
    text : 'Button 2'
    }
    ]
    }
    ]
    }, 
               {
                   width   : '250',
                   region : 'west',
    layout   : 'fit',
    collapsible : true,
    title : 'Navigation Panel',
    items : [navPanel]
               },
               {
    autoWidth   : true,
                   region : 'center',
    layout   : 'fit',
       items    : [grid]
               }
           ]
       });
    
    //  Grid code
    
    var grid = new Ext.grid.GridPanel(
    {
    id : 'gridPan',
    autoScroll : true,
    store : dstore,
    title   : 'Grid Panel',
    columns :
    [
    {id:'ipaddr', header: "ipaddr", sortable: true, dataIndex: 'ipaddr'},
    {id: 'devicetype', header: "devicetype", dataIndex: 'devicetype'},
    {id:'status', header: "status", dataIndex: 'status'},
    {id: 'description', header: "description", dataIndex: 'description'}
    ],
     columnLines : true,
    loadMask : true,
    stripeRows: true,
     autoExpandColumn: 'description'
      });

    when i am using forcefit is true, i am facing some problem like (Reloading problem,Horizontal scroll not coming and etc)

    Thanks in advance,

    Renganathan
    Thanks,

    RENGANATHAN M G

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,596
    Answers
    542
    Vote Rating
    324
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Please indent your code properly before posting it. There's not much point using CODE tags if you don't include decent indentation.

    Your question is quite confusing. Your grid has 4 columns. Could you describe exactly how you'd like each of them to be sized?

    I also see a lot of ExtJS 3 in your code. Are you are using ExtJS 3 or 4?

Thread Participants: 1

Tags for this Thread