Jqgrid Colmodel Configuration Parameters

Source: Internet
Author: User
Tags jqgrid

Colmodel Configuration Syntax Example
-Shrinkage JavaScriptCode jquery ("#gridid"). Jqgrid ({
//...
Colmodel: [{name:' name1 ', index:' index1 ' ...}, {...}, ...],
//...
});
The following table lists the properties available for Colmodel. The Name property is the only one that needs to be configured. The Colmodel configuration can be read and written through the Getcolprop and Setcolprop methods.
Configuration Items type Description Default Value
Align String Define the content alignment in a cell, available values: Left, center, right. Left
Cellattr function This method appends the cell to the property when it creates the cell contents. All available cell properties or values available in the Style property can be used, and this method needs to return a string. The parameters passed into this configuration method are as follows
rowId -the row ID that the cell belongs to
Val -The value displayed in the cell
Rawobject -The original data row object. An array object If datatype is JSON in the Jqgrid configuration. XML node when datatype is XML
cm -properties that are configured in all Colmodel that belong to this column
Rdata -the data row which is inserted in the row. parameter is a key-value pair object array, name is Colmodel defined by name
Null
Classes String Adds an additional style to the cell. If more than one style needs to be added, the style is separated by a space. For example: classes: ' Class1 class2 ' will set the Class1 and Class2 styles for this column cell. There is a predefined style in the CSS ui-ellipsis allows attaching to specific rows Empty string
Datefmt String When the SortType is configured to date (Datetype is set to local) or Editrules is configured as a {date:true} field, the display format of the date is defined. Use a time format such as PHP type. “/”,“-”,“.” The time-delimited symbol that can be used. The available time formats are as follows
Y,Y,YYYY: A year that corresponds to a 4-digit number
YY, yy: Year corresponding to 2 digits
M,MM: Corresponding month
D,DD: corresponding date
ISO Date (y-m-d)
Defval String As the default value for the search field. The initial value that is used only for custom searches. Empty
Editable Boolean Defines whether the field can be edited. For cell, row editing, and form editing. Reference: Jqgrid General editing rules False
Editoptions Array Provides a list of allowed values, based on EditType. Reference: Jqgrid General editing rules Empty array
Editrules Array Sets additional rules for the editable child. Reference: Jqgrid General editing rules Empty array
EditType String To the line, form Edit Configuration field Edit type. Possible values: text, textarea, select, checkbox, Password, button, image and file. Reference: Jqgrid General editing rules Text
Firstsortorder String When set to ASC or DESC, the column will be sorted according to this when initializing. Subsequent sorting will be switched in turn. Null
Fixed Boolean Even if the Jqgrid ShrinkToFit is configured as ture, the column width is not allowed to be recalculated when this configuration is true. If ShrinkToFit is true, calling the Setgridwidth method after the Jqgrid container's width changes does not modify the column width. False
Formoptions Array Defining configuration references when editing a form: Form options Empty
Formatoptions Array Overrides the configuration item in the default configuration language file. Reference: Jqgrid pre-defined format type None
Formatter Mixed The default type (string) or customer Custom function controls the display format for this field. Reference: Jqgrid pre-defined format type None
Frozen Boolean Set to Ture, this column will be fixed and not allowed to be dragged to change position. False
Hidedlg Boolean Set to true this column will not appear in the modal dialog box, and the user can choose to display or hide this column. Reference: Jqgrid Show and hide columns False
Hidden Boolean Defines whether this column is hidden at initialization time. False
Index String The name of the index at which sorting is set by the SIDX parameter. Detailed reference: Prmnames and Sortname configurations in the Jqgrid options configuration Empty string
Jsonmap String Defines the mapping relationships in this column Data key and the JSON data source. Reference: Jqgrid JSON data source Reader option configuration None
Key Boolean If the data part obtained from the server contains an ID, you can specify a unique ID column through this configuration. Only one column can specify this property, and if multiple columns are configured with this attribute, the first configuration will take effect and subsequently ignored. False
Label String If Jqgrid's colnames array is empty, this will be the column header for this column. If colnames and this configuration are empty, that name configuration will be used as the column header for this column. None
Name String Sets a unique name for this column. name is required . Jqgrid configured event names and attribute names, reserved words cannot be used as values for this configuration item, including SUBGRID,CB and RN. Required
Resizable Boolean Defines whether this column allows width adjustment True
Search Boolean Whether this column is allowed as a query condition after the query module is configured. Search Configuration True
SearchOptions Array Defining Query Options Search Configuration Empty
Sortable Boolean Define whether to allow clicking on the list header to sort True
SortType Mixed Valid when datatype is local. Defines the appropriate sort type. Available values
Int/integer: Sort by integer
Float/number/currency: Sort by number
Date: Sort Dates
Text: Sorting texts
Function: Sort by custom function. Custom functions accept the values ordered by this column and need to return a value. "Original: To this function we pass the value of be sorted and it should return a value too." It should be sorted with the JavaScript array using the function as the parameter sort, Retu Rn-1/0/1
Text
Stype String Defines the type of the query object. See Search Configuration Text
sURL String Custom searching in valid and EditType for ' select ' When this configuration gets the generated select HTML structure from which dynamic page address. Empty string
Template Object Sets the Colmodel valid property. This is useful when you want to override the default values for column mode. See Cmtemplate in Grid options Null
Title Boolean If set to False, the title hint message is not displayed when the mouse is moved to a cell. True
Width Number Sets the initial column width, in px. Note cannot be set to percent 150
XmlMap String Defines the XML node mappings in this column and in the XML file. Reference: Jqgrid XML data source Reader option configuration None
Unformat function Returns the original value of the cell, detailed reference: Jqgrid custom formatted type (also called unformat when sorting, return value for comparison during sorting) Null
Viewable Boolean This configuration is only valid under the Viewgridrow method. When configured to FALSE, this column does not appear in the View form. True

Translation Source: Http://www.trirand.com/jqgridwiki/doku.php?id=wiki:colmodel_options

time: 2013-06-25 comments: 0 Bobo Traditional Chinese

Original articles, reproduced please specify the Source: Jqgrid Colmodel configuration parameters

Jqgrid Colmodel Configuration Parameters

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.