Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Hyperlinking in GOJS

$
0
0

@re1nth wrote:

Hi,

I am trying to create a table with each row’s textBlock hyperlinked.

new go.Binding('itemArray', 'component')
{
itemTemplate :
$(go.Panel, 'TableRow',
    $(go.TextBlock, new go.Binding('text', 'name'),
      {
         click : function (e,obj){
           window.open(obj.part.data.URL);
          // the above part is where I need to embed the object specific link
       }
      }, {column: 0, font:'9pt sans-serif', margin:2  }
)
}

Node Data Array goes like this :

    [
          'key': 1,
          'component': [
          {'name': 'Row1', 'URL': 'www.google.com'},
          {'name': 'Row2', 'URL': 'www.youtube.com'}
          ]
    ]

I got many resources on how to hyperlink. But when it comes to using itemTemplate, how do I embed the URL property I defined in each object of the itemArray. I am able to bind the text of each object in the itemArray using go.Binding, but when it comes to binding URL, I am not sure how to embed it.
Can anyone give me some inputs how to approach this ?
I will be online till this thread will be closed. Please reply if anything is unclear.

Thanks in advance :)

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles