When the method is called it adds the following options automatically (see below) name, index, sorttype, key
Below is a list of properties for the colModel
Property |
Type |
Description |
Default |
---|---|---|---|
align |
string |
Defines the alignment of the cell in the Body layer, not in header cell. Possible values: left, center, right. |
left |
cellattr |
function |
Java script function which allow to set various properties for the cell dynamically. For more information see Cell Attributes |
null |
classes |
string |
This option allow to add classes to the column. If more than one class will be used a space should be set. By example classes:'class1 class2' will set a class1 and class2 to every cell on that column. In the grid css there is a predefined class ui-ellipsis which allow to attach ellipsis to a particular row. Also this will work in FireFox too. |
empty string |
datefmt |
string |
Governs format of sorttype:date (when datetype is
set to local) and editrules {date:true} fields. Determines the
expected date format for that column. Uses a PHP-like date
formatting. Currently ”/”, ”-”, and ”.”
are supported as date separators. Valid formats are: |
ISO Date (Y-m-d) |
defval |
string |
The default value for the search field. This option is used only in and will be set as initial search. |
empty |
editable |
boolean |
Defines if the field is editable. This option is used in cell, inline and form modules. See editing |
false |
editoptions |
array |
Array of allowed options (attributes) for edittype option. See editing |
empty array |
editrules |
array |
sets additional rules for the editable field editing. See editing |
empty array |
edittype |
string |
Defines the edit type for inline and form editing Possible values: text, textarea, select, checkbox, password, button, image and file. See editing |
text |
fixed |
boolean |
If set to true this option does not allow recalculation of the width of the column if shrinkToFit option is set to true. Also the width does not change if a setGridWidth method is used to change the grid width. |
false |
formoptions |
array |
Defines various options for form editing. See See formoptions |
empty |
formatoptions |
array |
Format options can be defined for particular columns, overwriting the defaults from the language file. See Formatter for more details. |
none |
formatter |
mixed |
The predefined types (string) or custom function name that controls the format of this field. See Formatter for more details. |
none |
hidedlg |
boolean |
If set to true this column will not appear in the modal dialog where users can choose which columns to show or hide. |
false |
hidden |
boolean |
Defines if this column is hidden at initialization. |
false |
index |
string |
Set the index name when sorting. Passed as sidx parameter. |
empty string |
jsonmap |
string |
Defines the json mapping for the column in the incoming json string. This option does not have in in jqGrid PHP |
none |
key |
boolean |
In case if there is no id from server, this can be set as as id for the unique row id. Only one column can have this property. If there are more than one key the grid finds the first one and the second is ignored. |
false |
label |
string |
When colNames array is empty, defines the heading for this column. If both the colNames array and this setting are empty, the heading for this column comes from the name property. |
none |
name |
string |
Set the unique name in the grid for the column. This property is required. As well as other words used as property/event names, the reserved words (which cannot be used for names) include subgrid, cb and rn. |
Required |
resizable |
boolean |
Defines if the column can be re sized |
true |
search |
boolean |
When used in search modules, disables or enables searching on that column. |
true |
searchoptions |
array |
Defines the search options used searching See Search Configuration |
empty |
sortable |
boolean |
Defines is this can be sorted. |
true |
sorttype |
string |
Used when datatype is local. Defines the type of the
column for appropriate sorting.Possible values: |
text |
stype |
string |
Determines the type of the element when searching - can be text or select. See here |
text |
surl |
string |
Valid only in and edittype : 'select' and describes the url from where we can get already-constructed select element |
empty string |
template |
array |
With this option is it possible to set a repeated properties in colMode for all or particular fields. By example if a lot of columns have a custom formating options for a number, you can define a sepaarte set of this options and then just point it on the setColProperty('field', array("template"=>myproperties)), where my properties is a set of valid colModel options |
null |
width |
number |
Set the initial width of the column, in pixels. This value currently can not be set as percentage |
150 |
xmlmap |
string |
Defines the xml mapping for the column in the incomming xml file. Use a CCS specification for this. This property does not have sense in jqGrid PHP |
none |
unformat |
function |
Custom function to “unformat” a value of the cell when used in editing See Custom Formatter. (Unformat is also called during sort operations. The value returned by unformat is the value compared during the sort.) |
null |
summaryType |
string or function |
This option have effect only if the grid grouping option is enabled and the groupSummary array in groupingView options is set to true. This determines the summary function which will be applied to each group. The following predefined function types are vailable:
|
empty string |
summaryTpl |
string |
This option have effect only if the grid grouping option is enabled and the groupSummary array in groupingView options is set to true. Determines the template for the summary footer information. The template can contain arbitrary text plus a value of {0} which is actually the result of the summar function for that group. For more info see grouping tutorial |
empty string |