Pass custom header renderer for Group in ag-grid - ag-grid

Need some help in passing custom header renderer for the multi Group column , when we set row Group : true for column Definition.

Could you perhaps supply an example of what you currently have in your gridOptions and colunDefinitions/columns? Worth knowing is that if you are using autoGroupColumnDef inside gridOptions, that will be the defining columnDefinition overriding the one you normally supply into "columns".
I assume you looked into custom component-header for your issue?

Related

Difference between UserProperties.Add and UserProperties.Set functionality in FlurrySDK

I'm using Flurry Analytics in my Unity game and I want to use Flurry UserProperties.
My question is about the difference between the functionality of UserProperties.Add and UserProperties.Set methods in FlurrySDK.
In the documents there is following description :
Set :
Sets and replaces (if any exist) the value(s) for the property.
Add :
Adds a User Property value(s). Adding values already included in the state has no effect and does not error.
Can I just use Flurry.UserProperties.Add whenever I need to set/add an UserProperty for a user and ignore Flurry.UserProperties.Set?
or I need to first define every property with Flurry.UserProperties.Add to be added in Flurry's panel and then use Flurry.UserProperties.Set to set them for a specific user?
Add adds to existing values, while Set removes existing values and then adds the new one
To create your custom User.property you do it in the Admin Panel of Flurry.
Set, clean your property and set with your last value you send.
Add , preserve the old values and add a new value to your property.

ag-grid: startEditing autoColumnDef for Tree View

I have an <ag-grid> using Angular and one thing I'm trying to do is when you click a button to add a row to the grid, I want to be able to focus and start editing the input for that row and that column
In the documentation, I have been able to get this working with various columns in various ag-grids in my app by using code like this:
this.gridApi.startEditingCell({
rowIndex: 0,
colKey: 'description'
});
However in one special case in one of my grids, I'm using the tree and autoGroupColumnDef like this:
<ag-grid-angular
#agGrid
style="width: 100%; height: 100%;"
id="myGrid"
class="ag-theme-balham"
[modules]="modules"
[columnDefs]="columnDefs"
[rowData]="rowData"
[treeData]="true"
[getDataPath]="getDataPath"
[defaultColDef]="defaultColDef"
[frameworkComponents]="frameworkComponents"
[groupDefaultExpanded]="groupDefaultExpanded"
[autoGroupColumnDef]="autoGroupColumnDef"
(gridReady)="onGridReady($event)"
(cellValueChanged)="handleChanges($event)"
(columnMoved)="handleColumnChanges($event)"
[getRowNodeId]="getRowNodeId"
[context]="this"
></ag-grid-angular>
And then in my typescript, I have my autoGroupColumnDef defined in my constructor like this:
this.autoGroupColumnDef = {
editable: true,
headerName: "Account #",
field: "accountNum",
filter: "agGroupCellRenderer",
cellRendererParams: {
suppressCount: true,
innerRenderer: 'AccountNameColumnDisplayer',
},
};
The problem is when I try to run the code like this:
this.gridApi.startEditingCell({
rowIndex: 0,
colKey: 'accountNum'
});
I get a warning that says ag-grid-community.cjs.js:27041 ag-Grid: no column found for accountNum
For the record, the data that I supply to this.rowData includes a property called accountNum
Is there something simple here that I'm not noticing or something I'm doing incorrectly? I have looked all over the ag-grid documentation and can't figure out how to solve this. Thanks in advance!
First off, lets be clear about the colKey. The colKey actually isn't directly tied to the field property. From the docs:
Some of the API methods take Column Key (named colKey) which has type
Column | string. This means you can pass either a Column object (that
you receive from calling one of the other methods) or you pass in the
Column ID (which is a string). The Column ID is a property of the
column definition. If you do not provide the Column ID, the grid will
create one for you (first by trying to use the field if it is unique,
otherwise it will generate an ID).
So, the colKey is either the column object itself, or, the colId you set in the column definition, the field property, or a random string (in that order).
Your first instinct may be to go and set the colId property of your autoGroupColumnDef column. But alas! In my experience, agGrid throws another curve ball at you and this will not work either...why?
This is because agGrid always makes the autoGroupColumnDef colId: ag-Grid-AutoColumn
TLDR: use the colKey "ag-Grid-AutoColumn" for autoGroupColumnDef column!
Cheers!
From what I can guess, I don't think your accountNum field is a part of columnDefs.
You need not provide field in autoColumnGroupDef, instead provide accountNum to actual columnDefs something like this -
{
field: 'accountNum',
hide: true,
}
Behind the scenes autoGroupColumnDefs is nothing but ag-grid group cell renderer on the column denoted with rowGroup=true.
Since your data is already in tree format, ag-grid takes care of grouping.
From the docs -
When the grid is working with Tree Data there is no need to explicitly
specify a Column Group as the grid will use the Auto Column Group.
The auto columns generated by the grid use the ag-Grid provided group
cell renderer. This means that gridOptions.autoGroupColumnDef can also
be used to pass additional properties to further customise how your
groups are displayed.
More details here

Group AEM (6.2) component configurations

I'm currently building a component that has TouchUI configuration properties separated with three tabs (Standard, CASL, GDPR). Each tab has the same set of options available and my current config names are similar to the following:
./standardMarketingText
./standardThirdpartyText
./gdprMarketingText
./gdprThirdpartyText
./caslMarketingText
./caslThirdpartyText
(There are several other options for standard,gdpr,casl but I left them out for brevity)
While this works, I'm hoping to instead store the values in the JCR as a JSON node per category. For example:
casl = {"marketingText"="m test", "thirdpartyText"="tp test"}
gdpr = {"marketingText"="gdpr m test", "thirdpartyText"="gdpr tp test"}
This way I can load all "casl" (or others) options at once when I need them (there isn't a case where I would only load one "casl" option)
I have attempted using granite/ui/components/foundation/form/multifield however, it asks to "Add field". I only want one set of each, and not provide the ability to add another set of properties under each tab. Is there a way to accomplish this without overriding the multifield resourceType?
There are multiple ways to achieve what you are looking at, I would look at the reusability as there are similar named properties for different categories (in your case tabs). To group them you could do that at node level by correctly defining the name property for each tab.
For above provided values, you could do something like -
./standard/marketingText
./standard/thirdpartyText
./gdpr/marketingText
./gdpr/thirdpartyText
./casl/marketingText
./casl/thirdpartyText
Your each tab stores the properties in named node (standard, gdpr, casl). In addition you could have a single SlingModel/WCMUsePojo that can adapt to these nodes to provide the Pojo with accessor to property values.
As far as getting JSON is concerned, your SlingModel or WCMUsePojo can provide a method to return JSON based string for the values.

Adding and removing Measures dynamically in sapui5 VizFrame

I would like to change Measures dynamically in my VizFrame like in ChartDemo App from sapui5 docs [link below].
https://sapui5.netweaver.ondemand.com/test-resources/sap/viz/demokit/chartdemo/index.html
So when I click to one of my five checkboxes the proper Measure will be added or removed in case of unchecking.
I have one json from which I get data.
I've tried with this code:
if(oCheckBox.getSelected()){
oVizFrame.removeFeed(feedValuesAxis);
feedValuesAxis.setValues("ValueFromJSON");
oVizFrame.addFeed(feedValuesAxis);
}
But it causes error:
[50005] - valueAxis : does not meet the minimum or maximum number of
feeds definition.
I am using SAP UI5 version 1.28.
I have one VizFrame, one Dataset with all Measures and two FeedItem one for values and one for Dimension.
I guess I have to create a binding, right? But how should I do it? Thanks a lot for any pieces of advice.
Simply, I have missed array when putting value into setValues() method.
So the answer is:
feedValuesAxis.setValues(["ValueFromJSON"]);

Kentico 9 macro for form field visibility

I have a custom page type, and the editor will have the option to enter the following
Image (from media library)
Video (from media library)
YouTube video ID
The field names are as follows
SlideImage
SlideVideo
YouTubeVideoID
So, if an editor ads a SlideImage, SlideVideo and YouTubeVideoID should not be usable. Same for SlideVideo and YouTubeVideoID.
Within the Visibility Condition fields, i'm going to assume a macro is needed for this. My logic is:
This field visible if Field A or B have data.
A possible approach can be to add an additional field, which determines the field that should be used.
Create a text field (let's say, SlideType) and use a radio button form control with your options:
image;Image
video;Video
youtube;YouTube
Tick the "Has depending fields" checkbox for this field, and tick the "Depends on another field" checkbox for the SlideImage, SlideVideo and YouTubeVideoID fields.
Your visibility conditions would then be simplified, instead of checking the values of multiple fields.
For example, the visibility condition for the SlideVideo field would be:
SlideType == "video"
This has a few benefits:
Easy to add new fields and configure the visibility conditions
Easy to check what needs to be rendered in the front-end - in your repeaters and other webparts, you can simply have conditional statements on the SlideType field to determine which field to use
Intuitive for the end user - the interface makes it clear which field is being used
Add this to Visibility condition in Page type field edit:
Fields.SlideImage.Value == String.Empty
Do not forget to set proper Has depending fields and Depends on another field properties depending on your needs. You can learn more about these properties here.
Let's say the column name on which this value of your depending field is "FirstName", so you can write in the dependent field -> Visibility Condition as
FirstName.value != ""
or
FirstName.value
You can twist the conditions for as many conditions as possible and can club more than one condition too.
I am also sharing links with you having a lot of examples from Kentico support
Dependency fields in Kentico
Using dependency fields in forms
Cheers,
Chetan