jqGrid 5.x colModel 詳解

jqGrid 5.1 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 This function add attributes to the cell during the creation of the data - i.e dynamically. By example all valid attributes for the table cell can be used or a style attribute with different properties. The function should return string. Parameters passed to this function are: 
rowId - the id of the row 
val - the value which will be added in the cell 
rawObject - the raw object of the data row - i.e if datatype is json - array, if datatype is xml xml node. 
cm - all the properties of this column listed in the colModel 
rdata - the data row which will be inserted in the row. This parameter is array of type name:value, where name is the name in colModel 

此功能在創建數據的過程中添加屬性的細胞-即動態。作爲例子,可用於表格單元格的所有有效屬性或具有不同性質的風格屬性。該函數返回的字符串。傳遞給該功能的參數是: ROWID -行的id VAL這將在細胞中增加的價值- rawObject -數據行的原始對象-即,如果數據類型是JSON -陣列中,如果數據類型是XML的XML節點。 釐米 -這列中的colModel列出的所有屬性 RDATA 這將在該行中要插入的數據行- 。該參數的類型名稱的數組:值,其中名稱是在colModel名稱
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. 

這個選項允許類添加到列。如果不止一個類將被使用的空間應設置。舉例類:“class1的類2”將在1類和類2設置爲在該列的每一個細胞。在網格中的CSS有一個預定義的類UI-省略號其允許省略附加到一個特定的行。這也將在FireFox中工作了。
empty string
colmenu boolean Enables/disables column menu to appear at particular grid header. This option is valid only if the grid option colMenu is set to true. See Column menu 

啓用/禁用列菜單出現在特定網格報頭。此選項僅對如果網格選項colMenu設置爲true。見欄菜單
true
coloptions object Defines a various options for colum menu if it is enabled.For more information see Column menu
定義各種選項的菜單科拉姆如果是enabled.For更多信息,請列菜單。
empty
datefmt string Governs format of sorttype:date (when datetype becomes local) or/and editrules [date:true] fields. Determines the expected date format for that column - i.e the format set here should correspond to the value which will be inserted into the grid. 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. 
The values is used to sort the date correct and validate it in case of editing with validation (editrules) See Array Data 
支配sorttype的格式:日期(當datetype變爲本地)或/和editrules [日期:真]字段。確定該列的預期日期格式-即此處設置的格式應該對應於將被插入到網格中的值。使用PHP般的日期格式。目前, “/”, “ - ”和“” 支持的日期分隔符。有效的格式爲: Y,Y,YYYY爲四位數年份 YY,YY爲兩位數年 男,毫米幾個月 D,DD爲天。 值被用於排序的日期正確,並與驗證(editrules)編輯的情況下進行驗證參見數組數據
Y-m-d
editable boolean Defines if the field is editable. This option is used in cell-, inline- and form-editing modules. By default this option is false, which means that in inline and cell editing the field is not allowed to be edit. In form editing the field does not appear into the edit form. See Editing 

如果定義字段是可編輯的。這個選項在細胞,inline-和形式編輯模塊中使用。默認情況下,這個選項是錯誤的,這意味着內聯和細胞中編輯字段是不允許被修改。在表單編輯字段不會出現到編輯形式。參見編輯
false
editoptions object Object of allowed options (properties) for the editable column. The option is valid if editable option is set to true. See Edit options 

允許的選項(屬性)可編輯的列對象。如果編輯選項設置爲true的選項是有效的。見編輯選項
empty
editrules object Object sets additional rules for the editable field. Mostly used for validation. See Edit rules 

對象設置爲可編輯字段附加規則。主要用於驗證。見編輯規則
empty
edittype string Defines the edit type for editing modules. Possible values: text, textarea, select, checkbox, password, button, image and file and etc. See also Edit type 

定義編輯模塊編輯類型。可能的值:文本,文本區域,選擇,複選框,密碼,按鈕,圖像和文件等。另請參見編輯類型
text
exportcol boolean Determines if the column should be exported when using exportToCsv, exportToExcel and exportToPdf methods. If set to false the column is not exported. See Exporting 

確定列是否應該使用exportToCsv,exportToExcel和exportToPdf方法時,被導出。如果設置爲false不會導出列。見導出
true
firstsortorder string Can be set to asc or desc, the column will be sorted in that direction on first sort. Subsequent sorts of the column will toggle as usual 

可設置ASC或DESC,該列將在第一那種方向進行排序。隨後各種各樣的列將切換如常
asc
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. 

如果設置爲true,如果shrinkToFit選項設置爲true,此選項不允許列的寬度重新計算。此外,如果使用setGridWidth方法來改變網格寬度的寬度不改變。
false
formoptions object Defines various options for form editing. See Form options 

定義表單編輯各種選項。見表格選項
empty
formatoptions object Format options can be defined for particular columns, overwriting the defaults from the language file. See Formatter for more details. 

格式選項可以爲特定列定義,覆蓋的語言文件的默認值。見格式化的更多細節。
none
formatter mixed Set predefined types (string) or custom function name that controls the format of this field. See Formatter for more details. 

設置預先定義的類型(字符串)或控制該字段的格式自定義函數的名稱。見 格式化的更多細節。
none
frozen boolean If set to true determines that this column will be frozen after calling the setFrozenColumns method. See Frozen Columns 
如果設置爲true確定此列將調用setFrozenColumns方法之後被凍結。見凍結列
false
hidedlg boolean If set to true this column will not appear in the dialog where users can choose which columns to show, hide or reorder using the columnChooser method jQuery UI Integrations or colMenu Column action

如果設置爲true此列將不會出現在對話框中,用戶可以選擇要顯示的列,隱藏或使用columnChooser方法重新排序的jQuery UI集成 或colMenu 列動作。
false
hidden boolean Defines if this column is hidden at initialization. The column is not editable and will not show in Form editing. Instead tha the column is hidden the data is presented in the grid. See methods hideCol and showCol. See editrules to edit a column in form edit when hidden. 

如果此列在初始化隱藏定義。該列不可編輯,並且不會在表單編輯顯示。相反,塔列是隱藏的數據呈現在網格中。見方法hideCol和showCol。見editrules時隱時現的形式編輯編輯列。
false
index string Set the index name when sorting. Passed as sidx parameter. If set this field is used in serching - i.e the field is send to the server for serching or used in local searching. 

排序時設置索引名。通過爲SIDX參數。如果設置此字段中serching使用 - 即場被髮送到服務器進行serching或在本地搜索中
empty
jsonmap mixed Defines the json mapping for the column in the incoming json request/string. Can be used as function with parameter the row data. See Retrieving JSON Data 

定義在輸入JSON請求/串列中的JSON映射。可作爲與參數行數據的功能。見檢索JSON數據
none
key boolean Overwrite the id (defined in readers) from server or array data. 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. When set this option is equal to the grid option keyName

從服務器或陣列數據覆蓋ID(在讀取器中定義)。可以設置爲ID爲唯一行標識。只有一列可以有此屬性。此選項擁有更高的優先權那些從讀者。如果有多個鍵設置網格找到的第一個和第二個被忽略。當設置這個選項等於電網選項的keyName。
false
label string When colNames array is empty, defines the header caption for this column. If both the colNames array and this setting are empty, the heading for this column is values of name property. 

當colNames數組爲空,定義此列的標題的標題。如果colNames陣列和這個設置都是空的,此列的標題是name屬性的值
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

在網格中的列設置唯一的名稱。此屬性是必需的。以及用作屬性/事件名稱換句話說,保留字(其不能被用於人名)包括次網格,Cb和RN。
Required
resizable boolean Defines if the column can be re sized with the mouse or resizeColumn method. 

定義如果列可以被重新定尺寸用鼠標或RESIZECOLUMN方法
true
search boolean When used in search modules, disables or enables searching on that column. Search Configuration 

當在搜索模塊中使用,禁用或該列允許搜索。搜索配置
true
searchoptions object Defines search options used in searching. Search Configuration 

定義搜索中使用的搜索選項。搜索配置
empty
sortable boolean Defines if the field can be sorted. If false click with the mouse on that column does not provide any action. 

如果定義字段進行排序。如果假以該列鼠標點擊不提供任何行動。
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 the same values as the build in JavaScript function sort - ie: 1, -1 or 0. 

自定義功能進行自定義排序時數據類型是本地的。三個參數a,b和方向被傳遞。的一個和b參數被比較的值,方向 是數字1和-1爲升序和降序。該函數返回值相同的JavaScript函數排序構建-即:1,-1或
null
sorttype mixed Used when datatype is local. Defines the type of the column for appropriate sorting and searching. Possible values: 
int/integer - for sorting integer 
float/number/currency - for sorting decimal numbers 
date - for sorting date (see datefmt parameter) 
text - for text sorting 
function* - defines a custom function for sorting type. To this function we pass the value to be sorted and it should return a value. 
See Array Data 

使用時,數據類型是本地的。定義適當的排序和搜索欄的類型。可能的值: INT /整數-用於排序整數 浮點值/數/貨幣-用於排序十進制數 日-用於排序日期(見datefmt參數) 文本-文本排序 功能* -定義排序類型的定製功能。爲了這個功能我們傳遞要排序的值,它應該返回一個值。 見數組數據
text
stype string Determines the input type of the element when searching - the possible values are text for creating input field and select for select element. See Search Configuration 

確定搜索時該元素的輸入類型-可能的值是文本創建輸入字段並選擇爲選擇元素。見搜索配置
text
surl string This option is deprecated. Use searchoptions : [dataUrl:'...'] instead. See Searching

此選項已被棄用。使用searchoptions:[dataUrl: '...']來代替。見搜索。
empty
template object Set of valid properties for the colModel. This option can be used if you want to overwrite a lot of default values in the column model with easy. By example you can define a common object with valid colModel options and set it here to overwrite default one. See also cmTemplate in grid options 

設置爲colModel有效屬性。如果要覆蓋了很多默認值的方便列模型,此選項可以使用。舉例,你可以定義有效colModel選擇一個共同的目標,在這裏將它設置爲默認覆蓋一個。又見cmTemplate 網格選項
null
title boolean If this option is false the title is not displayed in that column when we hover a cell with the mouse 

如果這個選項是錯誤的,當我們徘徊的小區,其鼠標的標題不顯示在列
true
width number Set the initial width of the column, in pixels. This value accept only number and the measure is in pixels. 

設置列的初始寬度,以像素爲單位。該值只接受號和措施以像素爲單位。
150
widthOrg number This width is equal to the initial set width and does not change during resizing of the grid. 

該寬度等於初始設定寬度和所述網格的尺寸調整期間不改變
150
xmlmap string Defines the xml mapping for the column in the incoming xml file. A CSS specification for this can be defined. Can be used as function with parameter the xmlrow data. See Retrieving Data 

定義在輸入XML文件的列中的XML映射。這樣做的一個CSS規範可以被定義。可作爲與參數xmlrow數據功能。見檢索數據
none
unformat function Custom function to "unformat" a value (to bring it in its original state) of the cell when used in editing and user defined formatter is used. See Custom Formatterand Editing. (Unformat is also called during sort operations. The value returned by unformat is the value compared during the sort.) 

自定義函數爲“無格”的值(以使其在它的原始狀態)的編輯和用戶定義的格式化器使用時,電池的使用。見自定義格式化 和編輯。(UNFORMAT期間排序操作也稱,通過格式化恢復返回的值是排序過程中比較的值。)
null
viewable boolean This option is valid only when viewGridRow method is activated. When the option is set to false the column does not appear in view Form. 

此選項纔有效viewGridRow方法被激活。當選項設置爲false列沒有出現在視圖形式
true
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章