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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

open a thingworx popup from html anchor tag.

lpthingworx
12-Amethyst

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

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

Announcements


Top Tags