带有 "title" 作为超链接的 SAP UI5 对象列表项
SAP UI5 Object List item with "title" as hyperlink
请建议带有超链接的对象列表项 "title" 并单击它,应该导航到新选项卡中的某些 url。
<List items="{ path: 'sonarReport>/measures' }"
id="sonarRepId"
mode="SingleSelectMaster"
selectionChange="onChange"
updateFinished="onFinsihed">
<ObjectListItem icon="{sonarReport>imageL}"
**title="{sonarReport>value}"**
class="sonarCustom"
type="Active">
<attributes>
<ObjectAttribute text="{sonarReport>metric}"></ObjectAttribute>
</attributes>
<firstStatus>
<ObjectStatus title="{sonarReport>state}"
icon="{sonarReport>image}"
state="Success"></ObjectStatus>
</firstStatus>
</ObjectListItem>
</List>
您可以选择像这样扩展 ObjectListItem
ObjectListItem.extend("ObjectListItemEx", {
metadata: {
events: {
titlePress: {}
}
},
renderer: {},
onAfterRendering: function() {
if (ObjectListItem.prototype.onAfterRendering) {
ObjectListItem.prototype.onAfterRendering.apply(this, arguments);
}
var that = this;
this.$().find(".sapMObjLTitle").each(function() {
var $this = $(this);
$this.click(function() {
that.fireTitlePress();
});
$this.css("cursor", "pointer");
});
}
});
我已经换成Custom List Item了,放不同的item很灵活
请建议带有超链接的对象列表项 "title" 并单击它,应该导航到新选项卡中的某些 url。
<List items="{ path: 'sonarReport>/measures' }"
id="sonarRepId"
mode="SingleSelectMaster"
selectionChange="onChange"
updateFinished="onFinsihed">
<ObjectListItem icon="{sonarReport>imageL}"
**title="{sonarReport>value}"**
class="sonarCustom"
type="Active">
<attributes>
<ObjectAttribute text="{sonarReport>metric}"></ObjectAttribute>
</attributes>
<firstStatus>
<ObjectStatus title="{sonarReport>state}"
icon="{sonarReport>image}"
state="Success"></ObjectStatus>
</firstStatus>
</ObjectListItem>
</List>
您可以选择像这样扩展 ObjectListItem
ObjectListItem.extend("ObjectListItemEx", {
metadata: {
events: {
titlePress: {}
}
},
renderer: {},
onAfterRendering: function() {
if (ObjectListItem.prototype.onAfterRendering) {
ObjectListItem.prototype.onAfterRendering.apply(this, arguments);
}
var that = this;
this.$().find(".sapMObjLTitle").each(function() {
var $this = $(this);
$this.click(function() {
that.fireTitlePress();
});
$this.css("cursor", "pointer");
});
}
});
我已经换成Custom List Item了,放不同的item很灵活