Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
wiki:groupingheadar [2011/10/11 14:47] tony |
wiki:groupingheadar [2017/12/09 14:52] (current) admin |
||
---|---|---|---|
Line 2: | Line 2: | ||
- | Header grouping is a way to add a additional column above the header grid rows, so that they are grouped of desired way.\\ | + | Header grouping is a way to add additional columns above the header grid rows, so that they are grouped in a way you need them.\\ |
- | Typical implementation can look like the picture below. | + | Typical implementation can look like the picture below: |
\\ | \\ | ||
\\ | \\ | ||
Line 11: | Line 11: | ||
\\ | \\ | ||
- | We support two type of grouping - with colSpan enabled and colSpan disabled. \\ | + | We support two types of grouping - with colSpan enabled and colSpan disabled. \\ |
If the colSpan is disabled (the default) the headers that do not have grouping have a additional cell above it.\\ | If the colSpan is disabled (the default) the headers that do not have grouping have a additional cell above it.\\ | ||
If the colSpan is enabled there is no additional cell above the non-grouped column and it is considered as one column. | If the colSpan is enabled there is no additional cell above the non-grouped column and it is considered as one column. | ||
Line 64: | Line 64: | ||
=== setGroupHeaders options === | === setGroupHeaders options === | ||
- | The method creates the group of headers in the grid. If the method is called, after the creation of the grouping header we store the group headers options as grid parameter. This grid parameters is called **groupHeader** and can be requested with getGridParam method after it is run and there destroyGroupHeader is not called (see below). \\ \\ | + | The method creates the group of headers in the grid. If the method is called, after the creation of the grouping header we store the group headers options as grid parameter. This grid parameters is called **groupHeader** and can be requested with getGridParam method after it is run and there is no call of destroyGroupHeader method (see below). \\ \\ |
The setGroupHeader method has the following options\\ | The setGroupHeader method has the following options\\ | ||
^Property^Type^Description^Default^ | ^Property^Type^Description^Default^ | ||
- | |useColSpanStyle|boolean| Determine if the non grouping header cell should be have cell above it - falue of false or the column should be treated as one combining boot - true| false| | + | |useColSpanStyle|boolean| Determine if the non grouping header cell should be have cell above it - value of false, or the column should be treated as one combining boot - true| false| |
|groupHeaders|array| A set of object(s) which describes the header grouping texts and rules. Bellow is the list of the options of every element of this array| empty| | |groupHeaders|array| A set of object(s) which describes the header grouping texts and rules. Bellow is the list of the options of every element of this array| empty| | ||
Line 93: | Line 93: | ||
</code> | </code> | ||
{{:wiki:grouping3.png|}} | {{:wiki:grouping3.png|}} | ||
+ | |||
+ | |||
+ | ===== Destroying group header ===== | ||
+ | |||
+ | To destroy group header call the **destroyGroupHeader** method. This method returns back the grid headers to its initial state. | ||
+ | |||
+ | The method can be called like this: | ||
+ | |||
+ | <code javascript> | ||
+ | ... | ||
+ | jQuery("#grid").jqGrid('destroyGroupHeader'); | ||
+ | ... | ||
+ | </code> | ||
+ | |||
+ | |||
+ | The method has optional one parameter. The parameter is boolean and its default state is true. If the parameter is set to false like : | ||
+ | <code javascript> | ||
+ | ... | ||
+ | jQuery("#grid").jqGrid('destroyGroupHeader', false); | ||
+ | ... | ||
+ | </code> | ||
+ | |||
+ | it restores the initial grid header, but does not destroy the grouping header options from which the group header is created. With other words the last group header parameters can be used later instead that the group header is destroyed | ||
+ | |||