cancel
Showing results for 
Search instead for 
Did you mean: 

Buttons in custom column of list report fiori elements

prathmeshtamhan
Discoverer

I have created a list report in sap fiori elements , created a custom column containing buttons in it , I want to disable enable button based on some condition. Binded model to that button. As shown in pic I want for docNum 1054 button containing text "Approve" to be enable for 1052 button to be disable 

prathmeshtamhan_1-1716190075173.png

 

prathmeshtamhan_0-1716190430436.png

 

 

rounak_roy
Advisor
Advisor
0 Kudos
You can defined a expression binding or model to the visible property of the Button, Ideally it should work. Also, If you can tell us more about the logic, based on which you want to enable/disable the button.
View Entire Topic
prathmeshtamhan
Discoverer
0 Kudos
Plz review below code tried but didnt work 
const value =  [
                {
                    "Status": true,
                    "DocNum": "10001"
                },
                {
                    "Status": true,
                    "DocNum": "10002"
                },
                {
                    "Status": false,
                    "DocNum": "10003"
                },
                {
                    "Status": false,
                    "DocNum": "1008"
                },
                {
                    "Status": false,
                    "DocNum": "1009"
                },
                {
                    "Status": false,
                    "DocNum": "1010"
                },
                {
                    "Status": false,
                    "DocNum": "1011"
                },
                {
                    "Status": false,
                    "DocNum": "1012"
                },
                {
                    "Status": false,
                    "DocNum": "1013"
                },
               
                {
                    "Status": true,
                    "DocNum": "1054"
                },
               
                {
                    "Status": false,
                    "DocNum": "1058"
                },
               
            ]
            var buttons = new JSONModel({
            buttonArray: value
            });
            this.getView().setModel(buttons, "buttonApproveModel");

<core:FragmentDefinition xmlns:core="sap.ui.core"
    xmlns="sap.m">
    <!--Column 1 Cell-->
    <Button icon="sap-icon://approvals" text="Approve Vendors" enabled="{= ${buttonApproveModel>/buttonArray} === true ? true : false }"  press="approveVendorEmail" type="Emphasized"></Button>
</core:FragmentDefinition>