Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
945
Auto Width setting?
posted

Is there a setting somewhere that will auto format the width of a column? I am exporting out a ton of grids and I would really like to think that I would not have to set each column's width manually.

Parents
No Data
Reply
  • 3595
    Suggested Answer
    posted

    Hello Ryan,

    Thank you for posting in our community!

    The igGrid has default value for the column widths. It is calculated as the whole grid width is divided by the number of the columns. These default values could be changed when the grid is initialized. I have added a code snippet which demonstrates how custom widths could be set for your reference:

        $("#grid1").igGrid({

            primaryKey: "ProductID",

            autoCommit: true,

            columns: [

                { headerText: "Product ID", key: "ProductID", dataType: "number", width: "30px" },

                { headerText: "Product Name", key: "Name", dataType: "string", width: "120px" },

                { headerText: "Product Number", key: "ProductNumber", dataType: "string", width: "100px" },

            ],

    When exporting is used it is expected the column widths values to be maintained.

    If you need more details could you please provide me additional information for your scenario? What are the grids exported to? Have you set default values for the column widths when the grids are initialized?

    Looking forwards to hearing from you.

     

Children