Author Topic: Dynamic column width not getting set  (Read 2525 times)

JUNZHONG

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 16
    • View Profile
Dynamic column width not getting set
« on: December 21, 2015, 09:29:35 pm »
We are creating dynamic columns for the grid based on user selection.
The problem is with the width of the dynamic columns. It is not getting set and all the dynamic columns are appended to the right side , width being very small. Please help.
grid configurations -
width: "auto",
 scrollModel: {
                    autoFit: true
                },

This is the code which adds the columns to the grid.
var j = 2;//number of static field on grid
for (var i = 0, len = data.length; i < len; i++) {
  var rowData = data;
          
   colM.push( { title: rowData["DisplayName"] + "    "+"<input type='checkbox' class='showHideInsColumn'    id='"+j+"' /> ", dataType: "float", minWidth: '30%', maxWidth:'50%', align: "center",colModel: [
                                    { title: "Data", align: "center", dataIndx: rowData["DisplayName"], dataType: "string" },
                                    { title: "EIN", align: "center", dataIndx: rowData["DisplayName"]+'_EIN', dataType: "string", hidden:true },
                                    { title: "Who", align: "center", dataIndx: rowData["DisplayName"]+'_Who', dataType: "string", hidden:true },
                                   { title: "Date", align: "center", dataIndx: rowData["DisplayName"]+'_Date', dataType: "string", hidden:true }
                                  ]
                       } );
            j=j+1;
       }

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Dynamic column width not getting set
« Reply #1 on: December 22, 2015, 05:38:34 pm »
Please set minWidth for visible columns in last level of hierarchy.

Code: [Select]
{ title: "Data", align: "center", dataIndx: rowData["DisplayName"], dataType: "string", minWidth: '30%', maxWidth:'50%' }