{
    "componentChunkName": "component---src-templates-doc-page-jsx",
    "path": "/angular-data-grid/group-cell-renderer/",
    "result": {"data":{"markdownRemark":{"htmlAst":{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If you are grouping in the grid, then you will need to provide a group cell renderer as the group cell renderer is what provides the user with the expand and collapse functionality."}]},{"type":"element","tagName":"h2","properties":{"id":"group-cell-renderer-configuration","style":"position:relative;"},"children":[{"type":"text","value":"Group Cell Renderer Configuration"},{"type":"element","tagName":"a","properties":{"href":"#group-cell-renderer-configuration","ariaLabel":"group cell renderer configuration permalink","className":["docs-header-icon","after"]},"children":[{"type":"element","tagName":"svg","properties":{"id":"icon","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 32 32"},"children":[{"type":"element","tagName":"path","properties":{"d":"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"},"children":[]}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The key for the group cell renderer is "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"agGroupCellRenderer"}]},{"type":"text","value":"."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The grid's group cell renderer takes many parameters to configure it. Here is an example of a column and its configuration:"}]},{"type":"element","tagName":"snippet","properties":{},"children":[{"type":"text","value":"\nconst gridOptions = {\n    columnDefs: [\n        // column definition configured to show group values with the cell renderer set to 'group'\n        {\n            showRowGroup: true,\n            cellRenderer:'agGroupCellRenderer',\n            // provide extra params to the cellRenderer\n            cellRendererParams: {\n                // turn off the row count\n                suppressCount: true,\n                // turn off double click for expand\n                suppressDoubleClickExpand: true,\n                // enable checkbox selection\n                checkbox: true,\n                // provide an inner renderer\n                innerRenderer: myInnerRenderer,\n                // provide an inner renderer\n                innerRendererParams: {foo: 'bar'},\n                // provide a footer value getter\n                footerValueGetter: myFooterValueGetter\n            }\n        }\n    ]\n}\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The full set of parameters for the group cell renderer are defined on "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"IGroupCellRendererParams"}]},{"type":"text","value":" and include:"}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"interface-documentation","properties":{"interfacename":"IGroupCellRendererParams","overridesrc":"group-cell-renderer/group-cell-renderer.json"},"children":[]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Below shows an example of configuring a group cell renderer. The example setup is not realistic as it has many columns configured for showing the groups. The reason for this is to demonstrate different group column configurations side by side. In your application, you will typically have one column for showing the groups."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The example is built up as follows:"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The data is grouped by two columns: "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Type"}]},{"type":"text","value":" (one of 'Fiction' or 'Non-Fiction') and "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Country"}]},{"type":"text","value":" (a country name, eg Ireland or United Kingdom)."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The column "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"'Country Group - No Renderer'"}]},{"type":"text","value":" configures the grid to put the 'Country' group data only into this column by setting "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"showRowGroup='country'"}]},{"type":"text","value":". All rows that are not this group are blank. There is no cell renderer configured, so the grid just places the text for the group into the cell, there is not expand / collapse functionality."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The column "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"'All Groups - no Renderer'"}]},{"type":"text","value":" builds on before, but adds all groups by setting "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"showRowGroup=true"}]},{"type":"text","value":". This gets the column to display all groups, but again no cell renderer so not expand / collapse functionality."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The column "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Group Renderer A"}]},{"type":"text","value":" builds on before, but adds the group cell renderer with "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"cellRenderer='agGroupCellRenderer'"}]},{"type":"text","value":". The values are exactly as per the previous column, except now we have expand and collapse functionality."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The column "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Group Renderer B"}]},{"type":"text","value":" builds on before, but adds "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"field=city"}]},{"type":"text","value":" so that the city is displayed in the leaf nodes in the group column."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The column "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Group Renderer C"}]},{"type":"text","value":" builds on before, but adds the following "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"cellRendererParams"}]},{"type":"text","value":":"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"suppressCount=true"}]},{"type":"text","value":": Suppresses the row count."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"suppressDoubleClickExpand=true"}]},{"type":"text","value":": Suppress double click for expanding."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"checkbox=true"}]},{"type":"text","value":": Adds a selection checkbox."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"innerRenderer=SimpleCellRenderer"}]},{"type":"text","value":": Puts custom rendering for displaying the value. The group cellRenderer will take care of all the expand / collapse, selection etc, but then allow you to customise the display of the value. In this example we add a border when the value is a group, and we set the colour based on whether the cell is a leaf node or not."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"grid-example","properties":{"title":"Group Cell Renderer Configuration","name":"group-renderer","type":"mixed","options":"{\"enterprise\": true, \"modules\": [\"clientside\", \"rowgrouping\"]}"},"children":[]}]},{"type":"element","tagName":"div","properties":{"className":["custom-block","note"]},"children":[{"type":"element","tagName":"div","properties":{"className":["custom-block-body"]},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If you require functionality that is not provided by the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"agGroupCellRenderer"}]},{"type":"text","value":", you can use a "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.1/component-cell-renderer/#custom-group-cell-renderer-example"},"children":[{"type":"text","value":"Custom Cell Renderer"}]},{"type":"text","value":" to provide your own extended functionality."}]}]}]},{"type":"element","tagName":"h2","properties":{"id":"conditionally-hide-group-cell-renderer","style":"position:relative;"},"children":[{"type":"text","value":"Conditionally Hide Group Cell Renderer"},{"type":"element","tagName":"a","properties":{"href":"#conditionally-hide-group-cell-renderer","ariaLabel":"conditionally hide group cell renderer permalink","className":["docs-header-icon","after"]},"children":[{"type":"element","tagName":"svg","properties":{"id":"icon","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 32 32"},"children":[{"type":"element","tagName":"path","properties":{"d":"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"},"children":[]}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"It is possible to conditionally hide the Group Cell Renderer. This might be useful in cases where the Expand / Collapse\nchevron should not be displayed in certain group cells."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"This can be achieved via the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"cellRendererSelector"}]},{"type":"text","value":" callback function as shown in below:"}]},{"type":"element","tagName":"snippet","properties":{},"children":[{"type":"text","value":"\nconst gridOptions = { \n    autoGroupColumnDef: {\n        cellRendererSelector: (params) => {\n          if (['Australia', 'Norway'].includes(params.node.key)) {\n            return; // use Default Cell Renderer\n          }\n          return { component: 'agGroupCellRenderer' };      \n        },\n    },\n};\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In the snippet above group cells that contain 'Australia' or 'Norway' group keys will use the Default Cell Renderer instead\nof the Group Cell Renderer. Note that a "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.1/component-cell-renderer/"},"children":[{"type":"text","value":"Custom Component Cell Renderer"}]},{"type":"text","value":" could also be returned."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"This is demonstrated in the example below. Note the following:"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"autoGroupColumnDef"}]},{"type":"text","value":" contains a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"cellRendererSelector"}]},{"type":"text","value":" to conditionally select the Cell Renderer."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Australia"}]},{"type":"text","value":" and "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Norway"}]},{"type":"text","value":" group cells are using the Default Cell Renderer."}]},{"type":"text","value":"\n"}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"grid-example","properties":{"title":"Conditionally Show Group Cell Renderer","name":"custom-expand-collapse-cell","type":"mixed","options":"{\"enterprise\": true, \"modules\": [\"clientside\", \"rowgrouping\"]}"},"children":[]}]}]},"frontmatter":{"title":"Group Cell Renderer","version":null,"enterprise":true,"sideMenu":null,"description":null},"headings":[{"id":"group-cell-renderer-configuration","depth":2,"value":"Group Cell Renderer Configuration"},{"id":"conditionally-hide-group-cell-renderer","depth":2,"value":"Conditionally Hide Group Cell Renderer"}]}},"pageContext":{"frameworks":["javascript","react","angular","vue"],"framework":"angular","srcPath":"/group-cell-renderer","pageName":"group-cell-renderer"}},
    "staticQueryHashes": ["1766026005","699667431","940729948"]}