tonytomov / jqGrid

jQuery grid plugin
www.trirand.com
2.84k stars 1.2k forks source link

Autowidth & Responsive properties don't behave correctly on hidden elements (for example inactive tabs) #930

Closed mdprw closed 5 years ago

mdprw commented 5 years ago

Autowidth & Responsive properties don't work correctly on hidden elements. When I instanciate jqgrid on an inactive tab the witdh of the grid is not calculated as it should. I know is not easy to calculate the width of hidden elements, but I would expect the grid to react when the tab is active and set the width accordingly. I could use the tab click event to set the width of the grid by myself using the width of the container but there's one remaining issue that I can't fix (Please read problem number 1).

I prepared a small demo here: http://jsfiddle.net/to6unkh9/

Problems: 1) On the grid of the second tab (inactive) if I set autowidth & responsive to true the action buttons get replaced by the text "action" with a menu. This is not the desired behavior since there's plenty of space to put the action icons. besides that, the "actions" menu doesn't work if I set the language to spanish.

2) On the first grid (active) the behavior is not consistent. You can see there's some space to allocate the scrollbar (I could set scrollOffset: 0 to fix this) but when you resize the browser that space is no longer present. Widths are calculated differently?

Thanks!

mdprw commented 5 years ago

This also happens with latest version (5.3.2)

tonytomov commented 5 years ago

Hello,

This is a well know discussion.

Please look at this discussion in order to get idea how to solve the problem.

mdprw commented 5 years ago

Ok, I choose to set the width when tab gets selected. Closing as solved.