json - Why doesn't the json model's odata property have columns?
问题描述
I am creating a JSON model in UI5 from a json object. But it is missing the columns array in the JSON model. I checked the model in the console and the odata property had no columns. Check image for proof.
Hence I want to know how I can get the column to show up.
Here is my code.
var emptyModel = {
"columns": []
};
this.setModel(new JSONModel(JSON.stringify(emptyModel)), "selcontent");
I expect column to show up in the JSON model under the odata property.
解决方案
JSONModel
awaits a plain object or a URL string as the first argument.
Either the URL where to load the JSON from or a JS object (source)
The result of the stringified emptyModel
is "{"columns":[]}"
which is neither an object nor a URL.
推荐阅读
- facebook - 为什么 Instagram Graph API webhook 不起作用
- python - 如何根据 y 坐标对二维数组进行排序
- c - 试图在 C 中逼近欧拉数
- python - 如何清除海龟的位置、旋转和其他已经制作好的东西。(Turtle 嵌入在 tkinter 窗口中)
- python - 安装了 gunicorn 但它不在 venv/bin 文件夹中
- font-awesome - 字体真棒:双色调只出现一半的时间
- java - 在 JUnit 测试中给定 JWT 令牌时,MockMVC 不返回任何值
- node.js - 如何修复 SyntaxError: Unexpected token ... 在我的本地机器上使用 socket.io
- google-app-engine - Google App Engine 的文件缓存有哪些选项?
- wordpress - 覆盖 woocommerce 添加购物车链接