cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1303
Views
0
Helpful
1
Replies

NeXt UI string concatenation under nx.ui.component

fmarangi
Cisco Employee
Cisco Employee

Hi Experts,

first of all I want to send you a lot of kudos for this amazing project.

I’m working in NSO / next ui project and I stuck in a stupid question that regards a String concatenation with a {#...} variable under nx.ui.component working as "MyNodeTooltip".

the code below in red is wrong and I wish know how solve this situation. I thought about another nested content object but i'm stuck.


thank you for your time.


Francesco

content: [{

      tag: 'a',

      content: '{#node.model.address}',

      props: {

           href: 'telnet://{#node.model.address}'

      }

      }]

1 Reply 1

achelminski
Level 1
Level 1

Hi,

I had the same problem with an http link, here is how I solved this:
nx.define('MyNodeTooltip', nx.ui.Component, {
properties: {
node: {},
topology: {}
},
view: {
content: [{
tag: 'p',
content: {
tag: 'a',
content: 'HW Detail',
props: {
href: '#'
},
events: {
'click': '{#open}'
}
}
}],
},
methods: {
open: function() {
this.inherited();
var hostname = this._node._label;
open('http://192.168.1.1/index.php?filter_RTR_NAME=' + hostname);
}
}
}