Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3184

Formatter function is too slow or setting default visible to false

$
0
0

Hello Experts,

 

I'm using images as a template for column

  var oImgCopyReq = new sap.ui.commons.Image({                    id  : "copyReq",                    tooltip : bundle.getText("ROW_ACTION_COPY"),                    src :"/images/copy.png",                          decorative : false,                                                  visible : {                           parts: [                                   {path : "oReqListModel>BtnVisible"}                           ],                                                    formatter : function(btnVisible) {                               if (btnVisible==="f") {                                   return false;                               } else {                                   return true;                               }                           }                          }                })                .addStyleClass("RowButtonsSpacer")                .attachPress({"controller" : that}, that.onCopyReq);

Two additional images the same as 'oImgCopyReq'

oImgPrintReq...

oImgAttachmentsReq...

       

       

        var oLayoutRowOperations = new sap.ui.layout.HorizontalLayout(                        oView.createId("Layout2"),                        {content: [oImgCopyReq, oImgPrintReq, oImgAttachmentsReq]}                );                                var oRowActionsCol = sap.ui.getCore().byId(this.createId('RowActionsCol'));            oRowActionsCol.setTemplate(oLayoutRowOperations);

Because the visible property default value is true when I run the code I see the images for all rows and after a second or two it becomes visible false (because the formatter function is invoked).

 

Formatter.png

How can I prevent this? changing default visible to false

 

Regards,

Omri


Viewing all articles
Browse latest Browse all 3184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>