Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9269

Re: Conditional background color for Table's/Lits's item in XMLView.

$
0
0

Hallo,

thanks for this solution!

I tried it with an XML view, but without success.

 

I get the following error message:

 

Uncaught Error: failed to load 'sap/m/cells.js' from resources/sap/m/cells.js: 404 - Not Found

 

Extended ColumnListItem:

 

(function () {    "use strict";    jQuery.sap.declare('test.control.MyLi');    jQuery.sap.require("sap.m.ColumnListItem");    var li = sap.m.ColumnListItem.extend("test.control.MyLi", {  metadata: {  properties: {  itemRole: {  type: "string",  defaultValue: "Normal"  }  }  },  renderer: {  renderLIAttributes: function(rm, oLI) {  rm.addClass("sapMListTblRow");  var vAlign = oLI.getVAlign();   if (vAlign != sap.ui.core.VerticalAlign.Inherit) {       rm.addClass("sapMListTblRow" + vAlign);     }    rm.addClass("css" + oLI.getItemRole());  }  }
});
return li;
}());

 

View:

<core:View  xmlns:core="sap.ui.core"  xmlns:l="sap.ui.layout"  xmlns="sap.m"  xmlns:my="test.control"

.....

 

<items>        <my:MyLi type="Navigation" itemRole="">        <cells>           <ObjectIdentifier title="{ShortText}"                                                                      text="{StatusText}" />        <ObjectStatus  text="{ path: 'AccRej', formatter: 'Test.util.CharTableFormatter.statusText' }"                       state="{ path: 'AccRej', formatter: 'Test.util.CharTableFormatter.statusState' }"/>        <Text text="{Result}" />        </cells>        </my:MyLi>        </items>

It works if I remove the <cells>... </cells> part, but then it's pretty useless ;-)

 

I don't know if I made an error or if this is generally not working. Has anyone a working solution for an extended ColumnListItem class in a XML view?

 

Cheers,

Hannes


Viewing all articles
Browse latest Browse all 9269

Trending Articles



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