티스토리 뷰

The colModel property defines the individual grid columns as an array of properties.
Syntax:
colModel: [ {name:'name1', index:'index1'...}, {...}, ... ]

The available colModel properties are listed here, in alphabetic order. All of these properties are values, there are no events or methods associated with the colModel. The only required property is name.


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
datefmt string Governs format of sorttype:date 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:
  • y,Y,yyyy for four digits year
  • YY, yy for two digits year
  • m,mm for months
  • d,dd for days
ISO Date (Y-m-d)
editable boolean Defines if the field is editable. This option is used in inline and form modules. false
editoptions array Array of allowed options (attributes) for edittype option empty array
editrules array editrules: {edithidden:true(false), required:true(false), number:true(false), minValue:val, maxValue:val, email:true(false), date:true(false)}
  • edithidden: if true, fields hidden in the grid are included as editable in form editing when add or edit methods are called.
  • searchhidden: if true, fields hidden in the grid are included in the search form.
  • required: if true the value will be checked and, if it is empty, an error message will be displayed.
  • number: if true the value will be checked to be sure it is a number and, if it is not, an error message will be displayed.
  • integer: if true the value will be checked to be sure it is an integer and, if it is not, an error message will be displayed.
  • minValue: if set to a valid number, the value will be checked and if it is less than the minValue, an error message will be displayed.
  • maxValue: the same as minValue but the value will be checked to be sure it is not greater than the maxValue.
  • email: if true, the value will be checked to ensure it conforms to a valid e-mail format (not that the email address exists) and, if it does not, an error message will be displayed.
  • date: if set to true, the format of the field is governed by the setting of the datefmt parameter

When a field is not required, the validation rules do not fire and so do not raise an alert for missing data. For example,
colModel: [
...
{...editrules:{required:false, number:true..}...}
...
]

In this case, if no data is provided by the user (it is left blank) the alert message does not appear - i.e. this is considered to be valid input.
empty array
edittype string Defines the edit type for inline and form editing
Possible values: text, textarea, select, checkbox, password
See also Inline editing and form editing
text
formatoptions array Format options can be defined for particular columns, overwriting the defaults from the language file. See formatter for more details. none
formatter string The predefined types 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. See Show/Hide Columns. false
hidden boolean Defines if this column is hidden at initialization. false
index string Set the index name when sorting. Passed as sidx parameter. the order of cell
jsonmap string Defines the json mapping for the column in the incoming json string. 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 and cb.
resizable boolean Defines if the column can be resized true
search boolean When used in formedit, disables or enables searching on that column true
sortable boolean Defines is this can be sorted. true
sorttype string Used when datatype is clientSide. Defines the type of the column for appropriate sorting.
Possible values:
  • int - for sorting integer
  • float - for sorting decimal numbers
  • date - for sorting date
  • text - for text sorting
text
width number Set the initial width of the column, in pixels 150
xmlmap string Defines the xml mapping for the column in the incomming xml file. Use a CCS specification for this
댓글