You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to document the onFieldsInitializing event which allows customers to customize the names, remove, and change positions of the fields.
revealView.onFieldsInitializing = function (args) {
var editedFields = args.fields;
// a example of how you can delete fields
// list of field names to be deleted
var exclude = ["Date", "Budget", "CTR", "Avg.CPC", "Avg. CPC", "Traffic"];
// deleted the fields
editedFields = editedFields.filter(f => !exclude.some(e => e == f.name));
//change name to show to Spend field to Spent
var fieldToChange = editedFields.find(f => f.name == "Spend");
if (fieldToChange) { fieldToChange.label = "Spent"; }
//change order
args.useCustomSort = true; //when set to true the fields are displayed in the same order as in args.fields
// if you want to re order only the first two positions
var newOrder = ["Organic %", "Spend"]; // change the order for the first two position,
//for this example spend will be in the first position and Organic in the second position,
//the rest of the fields will be kept in the order they had in args fields
newOrder.forEach(function (field) {
var moveFiled = editedFields.find(function (f) {
return f.name === field;
});
if (editedFields.indexOf(moveFiled) !== -1) {
editedFields.splice(editedFields.indexOf(moveFiled), 1);
editedFields.unshift(moveFiled);
}
});
args.fields = editedFields
}
The text was updated successfully, but these errors were encountered:
Description
We need to document the
onFieldsInitializing
event which allows customers to customize the names, remove, and change positions of the fields.The text was updated successfully, but these errors were encountered: