Last active
August 29, 2015 13:56
-
-
Save extstopcodepls/9206564 to your computer and use it in GitHub Desktop.
jqgrid autoresize
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function autoresizeGrid() { | |
| var $grid = $(this); | |
| var columns = $grid.jqGrid('getGridParam', 'colModel'); | |
| var colsTotalWidth = 0; | |
| for (var i = 0; columns[i]; i++) { | |
| colsTotalWidth += columns[i].width; | |
| $grid.setColProp(columns[i].name, { width: columns[i].width, widthOrg: columns[i].width }); | |
| } | |
| colsTotalWidth += 50; | |
| $(this).jqGrid('setGridWidth', colsTotalWidth, true); | |
| } | |
| // usage in init | |
| // resizeStop : autoresizeGrid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment