Jqgrid colmodel options

Source: Internet
Author: User

Colmodel is the most important attribute in jqgrid. It sets the attributes of table columns.

 

 

Attribute

Data Type

Remarks

Default Value

Align

String

Left, center, right.

Left

Classes

String

Set column CSS. Multiple classes are separated by spaces, for example, 'class1 class2 '. The default CSS attribute of the table is UI-ellipsis.

Empty string

Datefmt

String

"/", "-", And "." are valid date delimiters. Y, Y, yyyy YY, YY month m, mm for monthsd, dd Day.

ISO date (Y-m-d)

Defval

String

Default Value of the query field

Null

Editable

Boolean

Whether the cell can be edited

False

Editoptions

Array

Edit a series of options. {Name: '_ department_id', index: '_ department_id', width: 200, Editable: True, edittype: 'select', editoptions: {dataurl: "$ {CTX}/admin/deplistforstu. action "}. This shows how to dynamically obtain data from the server.

Empty

Editrules

Array

Edit Rules {Name: 'age', index: 'age', width: 90, Editable: True, editrules: {edithidden: True, required: True, Number: True, minvalue: 10, maxvalue: 100 }}, set the maximum age to 100, minimum value to 10, and numeric type, and mandatory field.

Empty

Edittype

String

Editable type. Optional values: Text, textarea, select, checkbox, password, button, image and file.

Text

Fixed

Boolean

Whether the column width is fixed and unchangeable

False

Formoptions

Array

Attribute settings for form editing

Empty

Formatoptions

Array

Formatting some columns

None

Formatter

Mixed

Function name or type set during column formatting

{Name: 'sex ', index: 'sex', align: 'center', width: 60, Editable: True, edittype: 'select', editoptions: {value: '0: TBD; 1: Male; 2: Female '}, formatter: function (cellvalue, options, rowobject ){
VaR temp = "If (cellvalue = 1 ){
Temp = temp temporary user-white.png ";
} Else if (cellvalue = 2 ){
Temp = temp temporary user-white-female.png ";
} Else {
Temp = temp + login user-silhouette.png ";
}
Temp = temp + "'border = '0'/>"
Return temp;
}}, // Returns the Gender icon.

None

Hidedlg

Boolean

Show or hide this column

False

Hidden

Boolean

Whether to hide this column during table Initialization

False

Index

String

Index. The interaction parameter with the background is sidx.

Empty

Jsonmap

String

Defines the returned JSON data ing.

None

Key

Boolean

If no ID is returned from the server, only one column can be used as the unique rowid. If you set more than one, select only the first one. Others are ignored.

False

Label

String

If colnames is empty, this value is used as the Column Display name. If none are set, the name value is used.

None

Name

String

Table column names, all keywords, and reserved words cannot be used as names including subgrid, CB and RN.

Required

Resizable

Boolean

Whether it can be resizable

True

Search

Boolean

In search mode, you can define whether this column can be used as a search column.

True

Searchoptions

Array

Set search parameters

Empty

Sortable

Boolean

Sortable or not

True

Sorttype

String

When datatype is local, define the type of the search column. Optional values: int/integer-float/number/currency-sort number date-Sort date text-Sort text

Text

Stype

String

Define the type of the search Element

Text

Surl

String

URL when searching data

Empty

Width

Number

The default column width, which can only be a pixel value, not a percentage.

150

Xmlmap

String

Defines the ing between the current column and the returned XML data

None

Unformat

Function

'Unformat' cell value

Null

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.