issues with spUtil.recordwatch

davilu
Mega Sage

I'm trying to use spUtil.recordWatch to update a widget.   My client script looks like this:

function($scope, $sce, spUtil, $timeout, $window, spModal, $location, spHRService, $rootScope, nowServer, $http, $uibModal, $mdDialog) {

/* widget controller */

var c = this;

c.server.get({

action: 'retrieve_data'

}).then(function(response) {

c.data.loading = false;

$scope.active_tasks = [];

$scope.active_workflow = '';

//Get link data

c.stage = response.data.stage;

c.currentOrder = response.data.currentOrder;

$scope.tasksDiv = false;

});

spUtil.recordWatch($scope, 'my_Tasks', "", function(name,data) {

spUtil.update($scope);

});

My recordWatch code above does nothing in terms of updating the widget, is there something I'm doing wrong or missing?

6 REPLIES 6

hi avaranasi and sanjivmeher,   I've tried both your suggestions but it still does not work.   My server script is contained in the following:



if (input && input.action == 'retrieve_data')



and my client script calls up on it like this:



c.server.get({


action: 'retrieve_data'


}).then(function(response) {



Is this somehow interfering with the recordWatch?   Do I need to refresh the server script somehow in order for the updated data to show?


Is this a widget on the same table or different tables?


Can you also post your server and html script?