Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Table mode based on two levels of model

$
0
0

Hi,

 

I have a sap.m.Table control where I want to set the mode property dynamically using a formatter.

 

My view is bound to the parent entity('thesises') and the items are bound with a sub entity('attachments'). So attachments is a subentity of thesises.

 

I want to use a property of both entities to decide the mode.

 

I tried this way, but that doesn't work:

 

mode: {                                                                                    parts : [ {                                                                                        path : 'uploadAllowed'                                                                                    },                                                                                    {                                                                                        path: 'attachments/attachmentType'                                                                                    }],                                                                                    formatter : function(                                                                                            changeAllowed, attachmentType) {                                                                                        if (uploadAllowed && attachmentType == "varia") {                                                                                            return "Delete";                                                                                        } else {                                                                                            return "None";                                                                                        }                                                                                    }                                                                                }

 

So the mode should be 'Delete' when 'changeAllowed is true and the attachmentTime is "varia" (on item level). If not, the mode should be "None"

 

Is there anyone who can help me?

 

Thanks!

 

RW


Viewing all articles
Browse latest Browse all 6178

Trending Articles



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