on 2021 Mar 17 12:13 PM
Hi All,
I am working on Custom SAPUI5 Application development using SmartControls. I have used SmartFilter Bar in my application. Date field is one of the filter bar items in the SmartFilter bar.
I need to apply the default value (Last 10 days) in the Smart Filter bar - Date field.
i am not using fiori elements. normal smart controls.
Thanks,
Regards,
Jayakrishnan.
Request clarification before answering.
Hello Jayakrishnan,
use the setFilterData-Method of the SmartFilterBar-Controller. The json data could look something like this:
//Create JSON data that contains the Inital value of the filter
var oDefaultFilter = {
"PurchaseOrderDate": {
"conditionTypeInfo": {
"name": "sap.ui.comp.config.condition.DateRangeType",
"data": {
"operation": "LASTDAYS",
"value1": 10,
"value2": null,
"key": "PurchaseOrderDate",
"calendarType": "Gregorian"
}
}
}
};
//Set SmartFilterBar initial values
oSmartFilterBar.setFilterData(oDefaultFilter);
In this example, PurchaseOrderDate is the ID of the filter field.
For more operations, see e.g following blog: How to use Smart Filter Bar with controlConfiguration conditionType as “DateRangeType”? | SAP Blogs
Regards
Thomas Deubel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.