cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

open a thingworx popup from html anchor tag.

lpthingworx
1-Newbie

open a thingworx popup from html anchor tag.

Hi,

i have created my own thingworx list widget using HTML template and angular js, that list have one column which rendered html anchor tag. currently on click of that anchor it opens new browser window.

anchor tag html looks like as below.

<a href="http://www.facebook.com/sharer" onclick="window.open(this.href, 'mywin','left=20,top=20,width=1024,height=600,toolbar=1,resizable=0'); return false;" >my image</a>

can we open thingworx popup instead of browser window on click of html anchor tag?

Regards,

Lalit

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

i have resolved this issue. I followed as below, also added some code snippet for better reference.

1) Created one widgetEvent in .ide.js file.

this.widgetEvents = function() {

  return {

       'linkClicked': { 'warnIfNotBound': true }

  }

};

2) Created one function in .runtime.js file, that function will trigger Event created in .ide file

$scope.imageLinkClicked = function(item) {

       $scope.widget.jqElement.triggerHandler('linkClicked');

};

3) In HTML template file, on click of anchor tag called function created in .runtime.js file

<td data-ng-repeat="document in item.Documents.rows" style="padding-right:5px;">

  <div data-ng-click="imageLinkClicked(item)">{{document.Name}}</div>

</td>

4) In Mashup, bound navigate event of navigation with linkClicked(this we have created in .ide.js file).

Thanks,

Lalit

View solution in original post

2 REPLIES 2
PaiChung
22-Sapphire I
(To:lpthingworx)

Take a look at the Navigation Widget which has the ability to do so.

Hi,

i have resolved this issue. I followed as below, also added some code snippet for better reference.

1) Created one widgetEvent in .ide.js file.

this.widgetEvents = function() {

  return {

       'linkClicked': { 'warnIfNotBound': true }

  }

};

2) Created one function in .runtime.js file, that function will trigger Event created in .ide file

$scope.imageLinkClicked = function(item) {

       $scope.widget.jqElement.triggerHandler('linkClicked');

};

3) In HTML template file, on click of anchor tag called function created in .runtime.js file

<td data-ng-repeat="document in item.Documents.rows" style="padding-right:5px;">

  <div data-ng-click="imageLinkClicked(item)">{{document.Name}}</div>

</td>

4) In Mashup, bound navigate event of navigation with linkClicked(this we have created in .ide.js file).

Thanks,

Lalit

Top Tags