Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
wiki:colmodel_options [2014/02/20 09:19] tony |
wiki:colmodel_options [2018/02/02 20:54] (current) admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
~~DISCUSSION~~ | ~~DISCUSSION~~ | ||
- | ~~ODT~~ | ||
=== ColModel API === | === ColModel API === | ||
The colModel property defines the individual grid columns as an array of properties. This is the most important part of the jqGrid. | The colModel property defines the individual grid columns as an array of properties. This is the most important part of the jqGrid. | ||
- | Syntax: | + | Syntax: |
<code javascript> | <code javascript> | ||
Line 36: | Line 35: | ||
|index|string|Set the index name when sorting. Passed as sidx parameter.|empty string| | |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. See [[Retrieving Data]] |none| | |jsonmap|string|Defines the json mapping for the column in the incoming json string. See [[Retrieving Data]] |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| | + | |key|boolean|Overwrite the id (defined in readers) from server. Can be set as id for the unique row id. Only one column can have this property. This option have higher priority as those from the readers. If there are more than one key set 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| | |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 | | |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 | | ||
Line 43: | Line 42: | ||
|searchoptions|array|Defines the search options used searching [[:wiki:search_config | Search Configuration]]|empty| | |searchoptions|array|Defines the search options used searching [[:wiki:search_config | Search Configuration]]|empty| | ||
|sortable|boolean|Defines is this can be sorted.|true| | |sortable|boolean|Defines is this can be sorted.|true| | ||
- | |sortfunc|function|Custom function to make custom sorting when datatype is local. Three parameters a, b and direction are passed. The //a// and //b// parameters are values to be compared direction is numeric 1 and -1 for ascending and descending order. The function should return 1, -1 and 0|null| | + | |sortfunc|function|Custom function to make custom sorting when datatype is local. Three parameters a, b and direction are passed. The //a// and //b// parameters are values to be compared direction is numeric 1 and -1 for ascending and descending order. The function should return 1, -1 or 0|null| |
|sorttype|mixed|Used when datatype is local. Defines the type of the column for appropriate sorting.Possible values: \\ int/integer - for sorting integer \\ float/number/currency - for sorting decimal numbers \\ date - for sorting date \\ text - for text sorting \\ function - defines a custom function for sorting. To this function we pass the value to be sorted and it should return a value too. \\ See [[wiki:retrieving_data#array_data | Array Data]] |text| | |sorttype|mixed|Used when datatype is local. Defines the type of the column for appropriate sorting.Possible values: \\ int/integer - for sorting integer \\ float/number/currency - for sorting decimal numbers \\ date - for sorting date \\ text - for text sorting \\ function - defines a custom function for sorting. To this function we pass the value to be sorted and it should return a value too. \\ See [[wiki:retrieving_data#array_data | Array Data]] |text| | ||
|stype|string| Determines the type of the element when searching. See [[:wiki:search_config | Search Configuration]]|text| | |stype|string| Determines the type of the element when searching. See [[:wiki:search_config | Search Configuration]]|text| |