Table of Contents

As of version 4.0 this module is no more supported. Please see
Upgrade notes in | Documentation menu

Description

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

Author

Piotr Roznicki

Installation

In order to use this module you should mark the Set Columns plugin (in Other modules) when you download the grid. For more information refer to Download.
For Developers - this is the grid.setcolumns.js in the src directory.

Calling Convention

Usually you can attach a click event to a button. You can use this method in navigator using the navButtonAdd method

jQuery("#mybutton").click(function() {
   jQuery("#grid_id").setColumns(options);
   return false;
});

Where:

 Show/ hide columns

This method uses the following options from language file

$.jgrid = {
...
	col : {
		caption: "Show/Hide Columns",
		bSubmit: "Submit",
		bCancel: "Cancel"
	},
...
OptionDescriptionDefault
topthe initial top position of the modal dialog. The zero value mean that the coordinate will be calculated from top left position of the grid and does not have effect if jqModal option is false0
leftthe initial left position of the modal dialog. The zero value mean that the coordinate will be calculated from top left position of the grid and does not have effect if jqModal option is false0
widththe width of the modal dialog200
heightthe height of the modal dialogauto
dataheightThis parameter control the scrolling content. The height parameter control the height of the entry modal, dataheight parameter control the height of the scrolling content keeping the buttons at the footer visibleauto
modalsets dialog in modal mode. Also does not have effect is jqModal is falsefalse
dragthe dialog is dragable. In order to work this either the jqDnR.js plugin should be included when you download the grid or the dragable component from jQuery UI should be usedtrue
beforeShowForma function that fires before showing the modal dialog (parameter is the id of the form)null
afterShowForma function that fires after showing the modal dialog (parameter is the id of the form)null
afterSubmitForma function that fire after the submit button is clicked (parameter is the id of the form)null
closeOnEscape determines if the modal can be closed if the user press ESC keytrue
ShrinkToFitIf set to true the grid width re size (fit) according to the visible columnsfalse
jqModal If set to true the method try to use the jqModal plugin for the modal dialogsfalse
colnameview If set to false the names from colModel will not be displayedtrue
closeAfterSubmitIf set to false the dialog will not be closed if the user press Submit buttontrue
onCloseThe event raised when a close icon is clicked, a cancel button is clicked or ESC key is pressed (if this is enabled). The function can return true or false. In case of false the dialog will not be closednull
saveiconThis is array element with the following default values [true,“left”,“ui-icon-disk”].
The item set various settings for the submit button. The first item enables the icon, the second item tells where to put icon left or right, the third item corresponds to valid ui icon from UI theme roller
closeiconThis is array element with the following default values [true,“left”,“ui-icon-close”].
The item set various settings for the close button. The first item enables the icon, the second item tells where to put icon left or right, the third item corresponds to valid ui icon from UI theme roller
updateAfterCheckWhen set to true the column is shown/hidden immediately upon clicking the checkbox. Choosing this options hides the submit button.false
recreateFormwhen set to true the form is recreated every time the dialog is activeted with the new options from colModel (if they are changed)false
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.