on 09-15-2015 8:01 AM
Hi,
Is it possible to pass addictional parameters to formatter function?
Hi Dongqiang,
Try using "PARTS" parameter.
Syntax:
sap.m.Text({text:"{parts:[{path:'BaseAmount'},{path:'Currency'}],formatter:'util.Formatter.amount'}"})
Check this Link for more details.
Thanks
Naveenraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, it's 'additional'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
using "parts" you can do,
src="{
parts: [
'/address/street',
'/address/zip',
'/address/city',
'/address/country'
],
formatter: '.formatMapUrl'
}"
/>
Sorry What you mean? mentioned path values are getting from the controller,In view you are specifying the path for that value and Formatter you will get it.
formatMapUrl: function(sStreet, sZip, sCity, sCountry) {
return "https://maps.googleapis.com/maps/api/staticmap?zoom=13&size=500x300&markers="
+ jQuery.sap.encodeURL(sStreet + ", " + sZip + " " + sCity + ", " + sCountry);
}
Hi Dongqiang
I believe that you can create a model on the fly to handle this.
var model = new sap.ui.model.jsnon.JSONModel({
constant1 : 'Hello',
constant2 : 'World'
});
sap.ui.getCore().getModel(model, 'constants');
then in the parts property, you can do
parts: ['constants>/constant1','constants>/constant3']
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.