tonytomov / jqGrid

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

"autowidth" strange behavior at start and after `resizeGrid` #996

Closed PaolaRuby closed 3 years ago

PaolaRuby commented 3 years ago

grid has a scrollbar's space at start, but after resizeGrid or trigger orientationEvent(responsive) the scrollbar's space disappears Example https://jsfiddle.net/f5vcd0z3/ (look at the right of the grid) image After resizeGrid or orientationEvent image When fill the grid image

console.log()

"----Initial widths----"
"#grid1: ",      480
"#gbox_grid1: ", 500
"----After resize widths----"
"#grid1: ",      500
"#gbox_grid1: ", 500

UPDATE: With $('#grid1 #norecs').remove(); after grid creation, makes scrollbar's space works again when resizeGrid or orientationEvent are called but only shows one row, emptyRecordRow breaks something? https://jsfiddle.net/jnbkq7cv/

"----Initial widths----"
"#grid1: ",      480
"#gbox_grid1: ", 500
"----After resize widths----"
"#grid1: ",      480
"#gbox_grid1: ", 500
tonytomov commented 3 years ago

Hello,

Thank you, I will check this and replay ASAP.

PaolaRuby commented 3 years ago

Removed

tonytomov commented 3 years ago

Hello,

Sorry for delay. I have found and fixed the problem. Please let me know if it is ok for you. In case it is fixed, please close the issue. Thank you again.

Best Regards, Tony

PaolaRuby commented 3 years ago

@tonytomov now it's working, thanks a lot

PaolaRuby commented 3 years ago

@tonytomov maybe the same issue, diferent steps with commit "Fix scrollbar in case no data and resizeGrid is called. Refere to: #996" UPDATED EXAMPLE: https://jsfiddle.net/pafhs8nd/1/

STEPS: First fill partially the grid(there is a scrollbar space) image Then trigger resizeGrid image For last fill with big data the grid image

tonytomov commented 3 years ago

@PaolaRuby ,

Thanks for investigations. This is correct behavior. The reason for this is that addRowData does not care about the scroll it just add records - sorry. After second fill calling resizeGrid will make it correct.

In order to prevent this maybe you will need to use setGridParam to update the data parameter and then reload the grid.