0
votes

In the AngularJS UI-grid I would like to auto resize columns after I click to one column hiding, because now if I click to hide clumn there will be a empty place at the place where the column was.

enter image description here

1
Not sure what you are experiencing but I don't think that's the current functionality ui-grid.info/docs/#/tutorial/210_selection . If you go use their demo and click hide, the other columns resize just fine.KreepN
I tried a lot of version and multiple browser but it not work for me... yes the demo work for me. But if I use the same code, it not work for me. :(user2695543
That's why you need to post your code here. Or create a Plnkr to replicate it and link us to it.KreepN

1 Answers

1
votes

This will most probably because you are setting the column width in you columnDef. The reason the demos work are because they dont specify the column width and they just resize after the columns are hidden. Check you column def and make sure you are not setting the column width.

 columnDefs: [
      { name: 'name',width:150 },
      { name: 'gender', enableHiding: false,width:150 },
      { name: 'company',width:150 }
    ],

 columnDefs: [
      { name: 'name' },
      { name: 'gender', enableHiding: false },
      { name: 'company' }
    ],

There will be differences in the behavior with the above configs.