Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
wiki:grouping [2014/02/19 14:47] tony |
wiki:grouping [2017/12/09 14:51] (current) admin |
||
---|---|---|---|
Line 3: | Line 3: | ||
Grouping is a way to group data by diffrent criteria. jqGrid currently supports one level of grouping. | Grouping is a way to group data by diffrent criteria. jqGrid currently supports one level of grouping. | ||
- | The simple way to group in jqGrid is to enable grouping with the grid option **grouping:true** and define a field name on which grouping occurs. The name should correspond to the name in colModel | + | The simple way to group in jqGrid is to enable grouping with the grid option **grouping:true** and define a field name on which grouping occurs. The name should correspond to the name in colModel. |
The definition is done with array //groupField// which is a part of another grid option **groupingView**. | The definition is done with array //groupField// which is a part of another grid option **groupingView**. | ||
Line 83: | Line 83: | ||
===== colModel Options ===== | ===== colModel Options ===== | ||
Additionally if the group summary footer row is enabled we use a option in column model to set the type of the summary field. | Additionally if the group summary footer row is enabled we use a option in column model to set the type of the summary field. | ||
- | We add two options in colModel and it name is **summaryType** and **summaryTpl**. | + | We add two options in colModel and it name is **summaryType**, **summaryTpl**, **summaryRound** and **summaryRoundType**. |
=== summaryType === | === summaryType === | ||
Line 133: | Line 133: | ||
===summaryTpl=== | ===summaryTpl=== | ||
This option acts as template which can be used in the summary footer row. By default its value is defined as {0} - which means that this will print the summary value. The parameter can contain any valid HTML code. | This option acts as template which can be used in the summary footer row. By default its value is defined as {0} - which means that this will print the summary value. The parameter can contain any valid HTML code. | ||
+ | |||
+ | ===summaryRound=== | ||
+ | <code javascript> | ||
+ | |||
+ | {..., summaryRound: number_of_digits, ... } | ||
+ | </code> | ||
+ | |||
+ | By default this parameter is not defined in colModel when grouping is on.\\ | ||
+ | The number_of_digits by default is not defined.\\ | ||
+ | This options determines the length of the remaining part after the decimal point. | ||
+ | |||
+ | ===summaryRoundType=== | ||
+ | <code javascript> | ||
+ | { summaryRoundType: 'round' | 'fixed' } | ||
+ | </code> | ||
+ | |||
+ | This parameter works only if the //summaryRound// is defined. | ||
+ | |||
+ | This is rounding method selector. | ||
+ | |||
+ | Parameter //round// means 'just round it and do not keep trailing zeroes'. //fixed// means 'round it and keep the given fixed number of digits even zeroes'. | ||
+ | |||
+ | The default option is set to round | ||
===== Methods ===== | ===== Methods ===== |