fix link multiple field

This commit is contained in:
yuri
2017-11-28 11:26:24 +02:00
parent 0075f42c58
commit df9320bb8c
+3 -2
View File
@@ -289,7 +289,7 @@ Espo.define('views/fields/link-multiple', 'views/fields/base', function (Dep) {
addLinkHtml: function (id, name) {
var $container = this.$el.find('.link-container');
var $el = $('<div />').addClass('link-' + id).addClass('list-group-item').attr('data-id', id);
$el.html(this.getHelper().stripTags(name) + '&nbsp');
$el.html(this.getHelper().stripTags(name || id) + '&nbsp');
$el.prepend('<a href="javascript:" class="pull-right" data-id="' + id + '" data-action="clearLink"><span class="glyphicon glyphicon-remove"></a>');
$container.append($el);
@@ -297,7 +297,8 @@ Espo.define('views/fields/link-multiple', 'views/fields/base', function (Dep) {
},
getDetailLinkHtml: function (id) {
return '<a href="#' + this.foreignScope + '/view/' + id + '">' + this.getHelper().stripTags(this.nameHash[id]) + '</a>';
var name = this.nameHash[id] || id;
return '<a href="#' + this.foreignScope + '/view/' + id + '">' + this.getHelper().stripTags(name) + '</a>';
},
getValueForDisplay: function () {