on 01-25-2016 7:37 PM
Hi Firends,
We have enabled standard FIORI Time approval app and working fine. Now the question is , I need to make a changes to UI which allows the user to show the records only for "Approved" or "For Approval" based on user some selection or filter criteria on Approval Status column.
Some times manager wants to see all Approved items rather then For Approval. So I need to provide a functionality where the manager can Sort or Filter with that specific status.
what is the easiest and best option for this changes? I am aware of the extension points view level and controller level. is there an easy way to sort the column data on FIORI UI using the sort functionality?
if sort is not possible, I may need to add a check box under neath or next to Approval Status , when the user select the check box I only show Approved, if they uncheck I show all of them , this can be a work around. Please suggest is there a better way to achieve this solution.
Attached screenshot.
Thanks
Krish
Extend the controller and view both
add the function like below in the controller.
handleChecked: function(oEvent) {
var h = false;
var e = oEvent.getParameters();
var oBinding = oEvent.getSource().getParent().getParent().getBinding("items");
if (e) {
h = e.selected;
}
if (h === true) {
var aFilters = [];
var oFilter = new sap.ui.model.Filter("a>STATUS_TEXT", "EQ", "Approved", "");
aFilters.push(oFilter);
oBinding.filter(aFilters);
} else {
oBinding.filter([]);
}
}
and view should have check box addition to the column like below
<Column demandPopin="true" id="S3StatusColumn" minScreenWidth="Tablet">
<CheckBox text="Approved" tooltip="click to get only approved" enabled="{a>MainCheckBoxState}" id="HeaderCheckbox1" select="handleChecked" />
<!--<header>-->
<!-- <Label design="Bold" text="{i18n>TSA_APPR_STATUS}"/>-->
<!--</header>-->
</Column>
regards,
Sarbjeet Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Sarbjeet. I will add this code and post the result. Also I have question, Once the Time Sheet approved it should disappear from the list right ? why still sitting and showing as Approved?
is there any setting i need to make if I want to remove the approved items from the list?
Thanks
Krishna
Hi Sarbjeet,
I have added the code view level and controller function as well.
When I select the checkbox, all entries are disappearing. It is not filtering out based on the "For Approval" status. ( i know you have mentioned the code for "Approved" ) .
When the user select "For Approval" check box , wanted to show him only the items status with For Approval.
Attached screenshot.
here showing no data, it suppose to display as only related to For Approval status.
code from view:
<Column demandPopin="true" id="S3StatusColumn" minScreenWidth="Tablet">
<!--<header>-->
<!-- <Label design="Bold" text="{i18n>TSA_APPR_STATUS}"/>-->
<!--</header>-->
<CheckBox text="For Approval" tooltip="click to get only approved" enabled="{a>MainCheckBoxState}" id="HeaderCheckbox1" select="handleChecked" />
From Controller method:
handleChecked: function(oEvent) {
var h = false;
var e = oEvent.getParameters();
var oBinding = oEvent.getSource().getParent().getParent().getBinding("items");
if (e) {
h = e.selected;
}
if (h === true) {
var aFilters = [];
var oFilter = new sap.ui.model.Filter("a>STATUS_TEXT", "EQ", "For Approval", "");
aFilters.push(oFilter);
oBinding.filter(aFilters);
} else {
oBinding.filter([]);
}
}
Thanks
Krish
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.