jQuery.sap.registerModulePath("sap.smartbusiness.ui.control", "/destinations/ssbruntime/sap/smartbusiness/ui/control/");
jQuery.sap.require("sap.smartbusiness.ui.control.Kpi");
var oSmartBusinessDrillDown = new sap.smartbusiness.ui.control.Kpi({
evaluationId: "E.12345679", //Evaluation ID *mandatory property
showAggregate : true/false, //to Show/Hide aggregate value in drilldown objectHeader
showFilters : true/false, //to Show/Hide facetFilter
showMiniChart : true/false, //to Show/Hide miniChart
showChart : true/false, //to Show/Hide chart
views : [array of viewID's of smartbusiness drilldown], //to restrict no. of charts/views shown in drilldown
showKpiTitle : true/false, //to Show/Hide KPI title in header of application
showEvaluationTitle : true/false //to Show/Hide evaluation title in header of application
});
var oContainer = new sap.m.VBox();
oContainer.addItem(oSmartBusinessDrillDown); //you can now place oSmartBusinessTile anywhere you like.
var overrideFilters = true;
var oFilters = [{
path: "SupplierId",
operator : "EQ",
value1 : "100000004"
},
{
path: "SupplierId",
operator : "EQ",
value1 : "100000027"
},
{
path: "SupplierId",
operator : "EQ",
value1 : "100000002"
}
]; //we expect filter format to be in above format
oSmartBusinessDrillDown.applyFilter(oFilters); //this way you can apply you oFilters on top of existing filters(evaluation e.t.c)
oSmartBusinessDrillDown.applyFilter(oFilters, overrideFilters) //it will override all existing filters applied on drilldown so far
"routes": [
{
"path": "/destinations/ssbruntime/",
"target": {
"type": "destination",
"name": "ssbruntime"
},
"description": "Destination for smartbusiness runtime UI application"
},
],
"securityConstraints": [
{
"protectedPaths": [
"/neo-app.json",
"<<your app component path>> or <<your application root path>>"
],
}
]
oSmartBusinessDrillDown.attachFilterChange(function(oEvent){
var oAddedFilters = oEvent.getParameter("addedFilters"); // New filters which has been added in facet
var oCurrentFilters = oEvent.getParameter("currentFilter"); // Current filter which is applied in facet
var oRemovedFilters= oEvent.getParameter("removedFilters"); // Filters which are removed
/**
* you can use these three filters array and act upon it
**/
});
oSmartBusinessDrillDown.attachChartViewChange(function(oEvent){
var currentViewSelected = oEvent.getParameter("viewId");
/**
* you can use this view ID for you action
**/
});
oSmartBusinessDrillDown.attachChartDataPointSelection(function(oEvent){
var currentDataPoint = oEvent.getParameter("currentDataPoint");
var allDataPointSelected = oEvent.getParameter("allDataPoint");
* you can use these parameters for your action.
**/
});
var oSmartBusinessDrillDown = new sap.smartbusiness.ui.control.Kpi({
evaluationId: "E.12345679", //Evaluation ID *mandatory property
});
var oSmartBusinessDrillDownNew = new sap.smartbusiness.ui.control.Kpi({
evaluationId: "E.1234567212", //Evaluation ID *mandatory property
});
var delegate = {
onFilterChange : function(filter) {
jQuery.sap.log.info("fire filterChange event on delegation " + filter);
/**
* you can write your own custom function with it.
*/
}
};
/**
* Adding business delegate accepts two arguments
* 1. delegate object
* 2. Array of events you want to add delegate to - It's optional if you don't give any arguments by default it's going to add delegate to filterChange event.
*/
oSmartBusinessDrillDown.attachOnAfterInitialization(function() {
oSmartBusinessDrillDown.addBusinessDelegate(delegate ); //adding custom delegate
oSmartBusinessDrillDown.addBusinessDelegate(oSmartBusinessDrillDownNew); //adding drilldown another instance as chain.
oSmartBusinessDrillDown.addBusinessDelegate(oSmartBusinessDrillDownNew,["viewTypeChange"]); //if you don't want filterChange event to be delegated provide array of event with event
//you want to add delegate
});
/**
* similarly you can remove business delegate
* here you explicitly need to mention the name of event you want to remove delegate from.
*/
oSmartBusinessDrillDown.attachOnAfterInitialization(function() {
oSmartBusinessDrillDown.removeBusinessDelegate(delegate, "filterChange"); //adding custom delegate
oSmartBusinessDrillDown.removeBusinessDelegate(oSmartBusinessDrillDownNew, "filterChange"); //adding drilldown another instance as chain.
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
38 | |
19 | |
13 | |
13 | |
10 | |
10 | |
10 | |
10 | |
8 | |
8 |