Show/Hide Columns

Author: Piotr Roznicki roznicki@o2.pl

Module name: modal dialog

Description: Display a modal window where the user can select which column to show and hide.

Installation: the new release of jquery.jqGrid.js defaults to this module being enabled, so ensure that grid.setcolumns.js and grid.setcolumns-min.js are copied to the appropriate folders. If you do not wish to include this function, make the appropriate change to jquery.jqGrid.js.


Calling Convention:

jQuery("#mybutton").click(function() {
	jQuery("#grid_id").setColumns(params);
});

where params is an array of name: value pairs, including any of the following:

Parameters

Property Description Default
top the initial top position of the modal dialog 0
left the initial left position of the modal dialog 0
width the width of the modal dialog 200
height the height of the modal dialog 185
modal sets dialog in modal mode false
drag the dialog is dragable true
beforeShowForm a function that fires before showing the modal dialog (parameter is the id of the form) null
afterShowForm a function that fires after showing the modal dialog (parameter is the id of the form) null


Note: To prevent showing or hiding columns that the developer does not want to show at all, a new option has been added to colModel: hidedlg (default false). If set to true this column will not appear in the modal dialog.


  Last Updated: 2/1/2009 | © Tony's jqGrid - a jQuery Plugin, 2010