We need a CheckBox, it can be added from the toolbar
Let’s change the background color of the CheckboxGroup. To do this, please click on the brush icon, bucket icon and then on more
Change color to hex 1f303f
Next change the font color
Set new color to white, hex ffffff
Remove the values from the Checkbox
Rename checkbox to CheckboxGroup_Dimensions, bu click on the keys icon
Add additional code to the Application - onInitialization
// Get all dimensions
vardimensions=Table_Games_Sales.getDataSource().getDimensions();
//Loop by dimensions and fill Checkbox
for ( vary=0; y<dimensions.length; y++ ){
CheckboxGroup_Dimensions.addItem(dimensions[y].id,dimensions[y].description);
}
Last but not least - we need a button
Rename the button
Let’s also add a code to handle it
// Get current list of dimensions to remove it
varcurrentDimensionsSet=Table_Games_Sales.getDimensionsOnRows();
// Get selected fields from CheckBox
varselectedDimensions=CheckboxGroup_Dimensions.getSelectedKeys();
// Delete all existing dimensions
for (varr=0; r<currentDimensionsSet.length; r++){
Table_Games_Sales.removeDimension(currentDimensionsSet[r]);
}
// Add all new dimensions
for (vari=0; i<selectedDimensions.length; i++){
Table_Games_Sales.addDimensionToRows(selectedDimensions[i]);
}
At the end-user should be able to pick up interesting dimensions by themself