I am using jqGrid with ui.multiselect.js for column choosing and reordering. The dialog which comes up is resizable but when resized, the contents of the dialog are not resized. Do you have to hook into any event do the stuff?
Asked
Active
Viewed 1,741 times
1
-
@Oleg I have posted this question. Dont know if you have encountered this problem. – chugh97 Jan 24 '12 at 20:04
-
If you want to send me a message you should do this in the comment of any my previous answers. Only in the case I'll receive the notification about. – Oleg Jan 24 '12 at 21:57
1 Answers
1
You are right. Currently it's a problem in the column chooser.
It's better to make some fixes in the code of the columnChooser
method. Before all you can improve the situation with resizing by making some changes in the Column Chooser dialog after the dialog is created. For example with the following code
$(this).jqGrid('columnChooser',
{width: 550, msel_opts: {dividerLocation: 0.5}});
var columnChooser = $("#colchooser_" + $.jgrid.jqID(this.id));
columnChooser.css('min-width', columnChooser.width() + 'px');
var dialog = columnChooser.closest('div.ui-dialog');
columnChooser.closest('div.ui-dialog').css('min-width', dialog.width() + 'px');
var div = columnChooser.children('div:has(div.ui-multiselect)');
div.css('width', '100%');
var uiMultiselect = div.children('div.ui-multiselect');
uiMultiselect.css('width', '100%');
uiMultiselect.children('div.available').css({width: '49.9%'});
uiMultiselect.children('div.selected').css('width', '49.9%');
you will have fairly good results with the horizontal resizing (see the demo). In the way you can either solve or at least have improve the results of resizing.
UPDATED: I posted here suggestions to make columnChooser really resizable. You can see the results on the demo.

Oleg
- 220,925
- 34
- 403
- 798
-
@chugh97: Look at the "UPDATED" part. I think I solved the problem with the resizing of `columnChooser`. You can get [here](http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.3.1/js/jquery.jqGrid.src-columnChooser.js) the version of `jquery.jqGrid.src` after my modifications. – Oleg Jan 27 '12 at 13:45
-
Hi @Oleg is this added in v4.4.4 or not. If not which version is this included. – Farrukh Subhani Jun 12 '14 at 13:18
-
@FarrukhSubhani: Tony didn't want to include my suggestion of changing of `columnChooser` in the code of jqGrid (without any clear explanation). So one needs to follow [my old suggestion](http://www.trirand.com/blog/?page_id=393/bugs/making-columnchooser-really-resizable/#p25823) and include the code of modified version of `columnChooser` *after* `jquery.jqGrid.min.js` to overwrite the code of `columnChooser` method. I uses the approach in all my projects since years and I never had any problem with the modified version of `columnChooser`. – Oleg Jun 12 '14 at 14:26
-
Thanks for update @Oleg. Do you have any link where you have this applied as a separate update or you have any script file that i can use to include after jqgrid js file. – Farrukh Subhani Jun 12 '14 at 17:05
-
I have seen your file http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.3.1/js/jquery.jqGrid.src-columnChooser.js above but I cant go back to 4.3.1 and one of my project is 4.4.4 and some are using latest version. Any common solution for all would really help. – Farrukh Subhani Jun 12 '14 at 17:08
-
@FarrukhSubhani: Look at [the answer](http://stackoverflow.com/questions/9687201/jqgrid-column-chooser-modal-overlay/9688942#9688942) with the part `$.jgrid.extend({columnChooser: function(opts) {...}});`. You can do the same. – Oleg Jun 12 '14 at 20:05