SAPUI5面板折叠/展开

时间:2017-01-15 18:27:08

标签: panel sapui5 collapse expand

是否可以将事件添加到SAPUI5 <?php $cSession = curl_init(); curl_setopt($cSession,CURLOPT_URL,"https://www.example.com/send?id=1&text=http://example2.com/song.mp3"); curl_setopt($cSession,CURLOPT_RETURNTRANSFER,true); curl_setopt($cSession,CURLOPT_HEADER, false); $result=curl_exec($cSession); curl_close($cSession); echo $result; ?> 最小化和最大化?我需要的是在单击Panel的折叠或展开按钮时添加不同的样式。

如果用户点击减号符号,我必须在用户点击“最大化”时添加类似from bs4 import BeautifulSoup import urllib2 import csv url = 'http://www.bbc.co.uk/sport/football/fa-cup/results' page = urllib2.urlopen(url).read() soup = BeautifulSoup(page) league = 'FA' for games in soup.find_all('table', class_='table-stats'): played_tag = games.find('caption') played = played_tag and ''.join(played_tag.stripped_strings) print played for match in soup.find_all('td', class_='match-details'): home_tag = match.find('span', class_='team-home') home = home_tag and ''.join(home_tag.stripped_strings) score_tag = match.find('span', class_='score') score = score_tag and ''.join(score_tag.stripped_strings) away_tag = match.find('span', class_='team-away') away = away_tag and ''.join(away_tag.stripped_strings) if ( score.split('-')[0] > score.rsplit('-')[1] ): home_win = 1 else: home_win = 0 if (score.rsplit('-')[1] > score.split('-')[0] ): away_win = 1 else: away_win = 0 if home and score and away: print league,',',home,',',home_win,',',score print league,',',away,',',away_win,',',score 的样式广告,并应在面板sap.ui.commons.Panel's

中添加不同的样式

如果我覆盖pnl.addStyleClass("XYZ");pnl.addStyleClass("ZYFDEFD");,则面板不会再崩溃或展开,因此必须找到其他内容。

1 个答案:

答案 0 :(得分:1)

有两种可能的选择......

1)您可以使用标准样式类(sapUiPanelColl),它根据展开状态添加到控件中 - 请参阅下面的示例...

var oPanel = new sap.ui.commons.Panel({});
oPanel.addStyleClass("myPanel");
oPanel.placeAt("content");
.myPanel { background-color: green; }
.myPanel.sapUiPanelColl { background-color: red; }
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>sap.ui.commons.Panel style class example</title>
</head>
<body id="content">
<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,sap.ui.commons"></script>

</body>
</html>

2)或者,如果从公共库中使用Panel不是必需的,则可以切换到sap.m.Panel(因为sap.ui.commons.Panel从版本1.38开始折旧)然后使用{{ 3}}