tonytomov / jqGrid

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

"resizeGrid" strange behavior when is responsive and height set to "auto" #995

Closed PaolaRuby closed 3 years ago

PaolaRuby commented 3 years ago

Height keeps growing when resizeGrid is called or when is reponsive and trigger orientationEvent Example https://jsfiddle.net/v47kqrx9/3/ image maybe if($t.p.height !== 'auto' && typeof height !== 'boolean' ) { or only where $t.p.height === '100%' on https://github.com/tonytomov/jqGrid/blob/bf643639f5f6b8953e03a14cd4af094d3903282b/js/grid.base.js#L6995 but on $("#gbox_"+$.jgrid.jqID($t.p.id)).parent().height() is the problem when parent has more elements, maybe the $t.p.height === 100% here https://github.com/tonytomov/jqGrid/blob/bf643639f5f6b8953e03a14cd4af094d3903282b/js/grid.base.js#L7021-L7025


also, var wh = $t.p.height, is mislocated https://github.com/tonytomov/jqGrid/blob/bf643639f5f6b8953e03a14cd4af094d3903282b/js/grid.base.js#L7008-L7009 i beleaves must be in https://github.com/tonytomov/jqGrid/blob/bf643639f5f6b8953e03a14cd4af094d3903282b/js/grid.base.js#L7021-L7022 so var bstw = $t.p.styleUI.search('Bootstrap') !== -1 && !isNaN(wh) ? 2 : 0 and maybe it should take wh when is set instead of the height of "parent"

MymsMan commented 3 years ago

I have also noticed this annoying behaviour If a table has insufficient rows (or filtering has reduced the number displayed) to fill a full screen the grid initially resizes to avoid white space at the bottom but a soon as the window width changes the table depth expands to the full window depth even if there is no data to display in the extra space.

fredsal commented 3 years ago

+1

erikn69 commented 3 years ago

+1

tonytomov commented 3 years ago

@PaolaRuby
Thank you. Good catch. I'm not sure how to process with this.

The same problem apply to the width. In your example add another p element and set it to float: right by example - you will see the similar problem.

For now I will fix only the check for height auto and miss-location of the

var wh = $t.p.height

Hope that we will have a fruitful discussion to resolve this problem.

PaolaRuby commented 3 years ago

Thank you, height='auto' works for me, also i see the width problem, but i haven't left/right elements

tonytomov commented 3 years ago

Hello,

Will close it. If there is a problem, please reopen it.

Thank you.

Best Regards, Tony

PaolaRuby commented 3 years ago

There is more issues in here, but height set to "auto" its working now, thanks