Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
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
Solved! Go to Solution.
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
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