refresh the widget data based on button click
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â01-16-2022 10:21 AM
once i click on a button i need to refresh the widget.
i tried with
$timeout(function(){
spUtil.update($scope);
}, 1000);
Stilll the list of records are not refreshed
Labels:
- Labels:
-
Service Portal Development
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â01-16-2022 10:50 AM
Your HTML should have a button click event handler.
<div>
<!-- your widget template -->
<button id="btn-alert" ng-click="c.onAlert()" class="btn btn-default">
Alert
</button>
</div>
Your client script should have a function defined
var c = this;
c.onAlert = function() {
c.data.action = 'update';
c.server.update().then(function(response) {
c.data.action = ''; //clear the action
});
}
Your Server script should respond to the action
if(input && input.action == 'update')
{
//handle the button click
console.log(JSON.stringify(input));
}
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022
Vinod Kumar Kachineni
Community Rising Star 2022
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â01-16-2022 10:52 AM
Also what was the out come of the questions on the issue with data.final = vale; that you asked previously.
Can't find the questions.
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022
Vinod Kumar Kachineni
Community Rising Star 2022