From 8265b2b543767e1353dee2c0406fd674e5117ee7 Mon Sep 17 00:00:00 2001 From: SilverFire - Dima Naumenko Date: Sat, 17 Oct 2015 17:07:40 +0300 Subject: [PATCH] HdomainIpCombo - changed formatResult --- src/widgets/ip/HdomainIpCombo.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/widgets/ip/HdomainIpCombo.php b/src/widgets/ip/HdomainIpCombo.php index 67f0084d..d345c818 100644 --- a/src/widgets/ip/HdomainIpCombo.php +++ b/src/widgets/ip/HdomainIpCombo.php @@ -58,7 +58,8 @@ function (data) { used_ips[ip] = true if (v.links) { $.each(v.links, function(k,link) { - row.text = link.service + ': ' + ip; + row.text = ip; + row.service = link.service; }); } else { row.text = ip; @@ -69,8 +70,20 @@ function (data) { return {results: ret}; } - ") + "), ], + 'formatResult' => new JsExpression(" + function(row) { + if (!row.service) return row.text; + return row.service + ': ' + row.text; + } + "), + 'formatSelection' => new JsExpression(" + function(row) { + if (!row.service) return row.text; + return row.service + ': ' + row.text; + } + ") ] ], $options)); }