You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The angle:
I am tweaking filterGrid object to size itself properly in "horizontal" mode, with gridToolbar=true. By properly I mean:
do NOT skip search=false; columns. Instead, render a td with nothing inside, with width equal to the that of corresponding column.
Include all visible columns in the rendering, including "cb" so that when the filterGrid is put on top of the columns, it lines up the input fields more or less exactly over the searchable columns.
The Problem:
When filterGrid builds the array of settings it will use for the filterGrid object, it looks at colModel. colModel for some reason does not have the actual size of the columns when the columns were resized by hand. As a result of that, the search input fields are built with width different from actual column widths. As a result of that, the input fileds do not line up on top of columns.
On occasion, I would like to store the view as configured by web site user. This should include the new width of resized columns. jqGridExport seems like a logical choice for getting the settings, but, because colModel is not updated when columns are resized, I am forced to scan grid.p.headers[i].width separately through evens system and put that in post data. Pain.
The solution:
Alter the 2 lines of code on Line 133. grid_base.js (v3.4.x) to look something like this:
You are right the filterGrid method does not resize the columns when the grid is resized. The purpose oh this method is other and I show only one exmaple how this can be used. Developing this example I do not suppose that this will be so popular.
Instead in 3.5 version I have created another method filterToolbar which do job.
This is true and fixed in 3.5 version.
Will try to fix in 3.4.4
Thanks
Regards
The angle:
I am tweaking filterGrid object to size itself properly in "horizontal" mode, with gridToolbar=true. By properly I mean:
The Problem:
The solution:
Alter the 2 lines of code on Line 133. grid_base.js (v3.4.x) to look something like this:
var newColWidth = this.headers[idx].newWidth || this.headers[idx].width;
this.headers[idx].width = newColWidth;
this.cols[idx].style.width = newColWidth;
p.colModel[idx].width = newColWidth;
The text was updated successfully, but these errors were encountered: