OpenUI5-显示JSON字符串的sap.m.Text问题 [英] OpenUI5 - sap.m.Text issue with displaying JSON string

查看:143
本文介绍了OpenUI5-显示JSON字符串的sap.m.Text问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用sap.m.Text

由于字符串"{...}"

我认为可能有一个参数可以禁止任何形式的原始文本的绑定,但是从API来看我看不到这种东西.

I thought there may be a parameter to disable binding allowing any kind of raw text, but looking at the API I see no such thing.

https://openui5.hana. ondemand.com/docs/api/symbols/sap.m.Text.html#constructor

这是问题的一个例子:

http://jsbin.com/zarijedaya/1/edit?html, js,输出

推荐答案

您可以使用setText方法,该方法会将JSON作为字符串.

You can make use of the setText method which will consider the JSON as a string.

new sap.m.Text().setText(json);

http://jsbin.com/bonoxavilo/1/edit

这篇关于OpenUI5-显示JSON字符串的sap.m.Text问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆