在 js 视图中插入提要磁贴。容器 1 和容器 2 正在形成瓷砖,但进料瓷砖出现错误
Insert a feed tile in js view. container 1 and container 2 the tiles are forming but feed tile there is a error
<!DOCTYPE html>
<html>
<head>
<script src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js" id="sap-ui-bootstrap" data-sap-ui-theme="sap_bluecrystal" data-sap-ui-libs="sap.m"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<script>
var container1 = new sap.m.TileContainer({
height : "50%",
tiles : [
new sap.m.StandardTile({
icon : "sap-icon://play",
title : "Important Tile"
}),
new sap.m.StandardTile({
icon : "sap-icon://pause",
title : "ANOTHER Important Tile"
}),
new sap.m.StandardTile({
icon : "sap-icon://pause",
title : "ANOTHER Important Tile"
}),
new sap.m.StandardTile({
icon : "sap-icon://pause",
title : "ANOTHER Important Tile"
})
]
})
var container2 = new sap.m.TileContainer({
height : "50%",
tiles :[
new sap.m.StandardTile({
icon : "sap-icon://play",
title : "Important Tile"
}),
new sap.m.StandardTile({
icon : "sap-icon://pause",
title : "ANOTHER Important Tile"
}),
]
})
var oTwoDaysAgo = new Date();
oTwoDaysAgo.setDate(oTwoDaysAgo.getDate() - 2);
var oFinanceArticle = new sap.suite.ui.commons.FeedItem({
title: "Help! My Sister Wants Me Off Her Credit Cards",
image: "images/balloons.jpg",
link: "http://finance.yahoo.com/news/help-sister-wants-off-her-110045864.html",
source: "Yahoo Finance",
publicationDate: oTwoDaysAgo
});
var oHourAgo = new Date();
oHourAgo.setHours(oHourAgo.getHours() - 1);
var oStyleArticle = new sap.suite.ui.commons.FeedItem({
title: "How To Be In Style This Season",
image: "images/grass.jpg",
link: "http://www.zappos.com/",
source: "Zappos",
publicationDate: oHourAgo
});
var articles = new Array();
articles.push(oStyleArticle);
articles.push(oFinanceArticle);
var container3 = new sap.m.TileContainer({
height : "50%",
tiles: [
new sap.suite.ui.commons.FeedTile({
items: articles,
})
]
});
new sap.m.App({
pages : new sap.m.Page({
enableScrolling : true,
title : "Agri",
content : [container1, container2, container3]
})
}).placeAt("content");
</script>
<body id="content">
</body>
</html>
我认为您不能将 sap.suite.ui.commons.FeedTile
直接嵌入到 TileContainer 中;你应该先将它嵌入 sap.m.CustomTile
<!DOCTYPE html>
<html>
<head>
<script src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js" id="sap-ui-bootstrap" data-sap-ui-theme="sap_bluecrystal" data-sap-ui-libs="sap.m"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<script>
var container1 = new sap.m.TileContainer({
height : "50%",
tiles : [
new sap.m.StandardTile({
icon : "sap-icon://play",
title : "Important Tile"
}),
new sap.m.StandardTile({
icon : "sap-icon://pause",
title : "ANOTHER Important Tile"
}),
new sap.m.StandardTile({
icon : "sap-icon://pause",
title : "ANOTHER Important Tile"
}),
new sap.m.StandardTile({
icon : "sap-icon://pause",
title : "ANOTHER Important Tile"
})
]
})
var container2 = new sap.m.TileContainer({
height : "50%",
tiles :[
new sap.m.StandardTile({
icon : "sap-icon://play",
title : "Important Tile"
}),
new sap.m.StandardTile({
icon : "sap-icon://pause",
title : "ANOTHER Important Tile"
}),
]
})
var oTwoDaysAgo = new Date();
oTwoDaysAgo.setDate(oTwoDaysAgo.getDate() - 2);
var oFinanceArticle = new sap.suite.ui.commons.FeedItem({
title: "Help! My Sister Wants Me Off Her Credit Cards",
image: "images/balloons.jpg",
link: "http://finance.yahoo.com/news/help-sister-wants-off-her-110045864.html",
source: "Yahoo Finance",
publicationDate: oTwoDaysAgo
});
var oHourAgo = new Date();
oHourAgo.setHours(oHourAgo.getHours() - 1);
var oStyleArticle = new sap.suite.ui.commons.FeedItem({
title: "How To Be In Style This Season",
image: "images/grass.jpg",
link: "http://www.zappos.com/",
source: "Zappos",
publicationDate: oHourAgo
});
var articles = new Array();
articles.push(oStyleArticle);
articles.push(oFinanceArticle);
var container3 = new sap.m.TileContainer({
height : "50%",
tiles: [
new sap.suite.ui.commons.FeedTile({
items: articles,
})
]
});
new sap.m.App({
pages : new sap.m.Page({
enableScrolling : true,
title : "Agri",
content : [container1, container2, container3]
})
}).placeAt("content");
</script>
<body id="content">
</body>
</html>
我认为您不能将 sap.suite.ui.commons.FeedTile
直接嵌入到 TileContainer 中;你应该先将它嵌入 sap.m.CustomTile