Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8004001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:48:05+00:00 2026-06-04T16:48:05+00:00

I am loading a grid dynamically in extjs. As you can see below the

  • 0

I am loading a grid dynamically in extjs. As you can see below the column “Created” is not wide enough to display whole text in it. I want to set every column’s width such that it display’s its text completely.

enter image description here

Is this possible to do? Any suggestion?

Thanks for help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:48:05+00:00Added an answer on June 4, 2026 at 4:48 pm

    Thanks bensiu, I implemented the login. However, I cannot say that this is the ideal solution but it solves my purpose.

    First, i navigate through data and find the longest string in that column (including header name of that column).

    // Store the longest string for each column in columns[col].maxstring 
    
    // Define a hidden label
    {
        xtype: 'label',
        id: 'lblTab',
        hidden: true
    }
    
    var lblTab = Ext.getCmp('lblTab');
    var hiddenField = Ext.util.TextMetrics.createInstance(Ext.getCmp('lblTab').el);
    var widthValue = 0;
    
    // Iterate through each columns to set its maximum width
    for(var col in columns) {
        // find width of string
        widthValue = hiddenField.getWidth(columns[col].maxstring);
    
        // set column width
        colModel.setColumnWidth(columns[col].index, widthValue + 20, false);  
    }
    

    I hope this helps somebody.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to adding custom message to loading map in grid? ExtJs 3.*
So I have a ExtJs 4 Grid Panel that has two columns. Column ONE
In my ExtJS 4 Grid, I would like to set the height dynamically upon
Proxy update on ExtJS is not loading my update API instead it loads URL
I have a Grid View in my android app.I am loading images to the
I have a data grid loading row event _gridObj.LoadingRow += new EventHandler<DataGridRowEventArgs>(_gridObj_LoadingRow); and in
When my grid is loading data from server (the Loading box is showed) but
In a page that has a grid/list dynamically loaded via AJAX, an efficient way
I'm loading user controls in a specific grid in our application and I'm adding
I have a grid containing name and value columns. In value column I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.