How to pass data to server in widget on click of tabs

abhishekte
Mega Expert

Hi- I am configuring data table widget   and I have created two tabs like My tickets, My assigned tickets on HTML. When user click on those tabs I have pass tab value and specific data to server so that it can return value based on tab click.

Has anyone implemented such thing in service portal. It would be great if any direction would be provided.

15 REPLIES 15

Hi Scott- Could you please elaborate your requirement. I somehow managed to completed my required using ng-click (assume c.setTab(1)) oneach tab. I have written onclick function on client controller and used server.get to pass input to server and based on that server side will return data to view.


Example:



c.setTab = function (tabId) {  



          c.tab = tabId;


          var x= c.tab;   //assigning value to custom varible



//qs is custom variable which we pass from client side to server side. On server side use if (input.qs) to get the value and run your code accordingly.//


  $scope.server.get({qs: x}).then(function(r) {


  $scope.data.p = data.response;


}



Hoe this will help.


Does your approach break the browser history (back button)?


No..Everything is working fine.


I think my requirements differ but only slightly.   The display of data isn't the problem, it's the dynamic number count that needs to be updated based on the record watcher for that data.   So, for each tab you have, add a display count of the total records found and I believe the server.get is never fired when the watcher runs, i.e when a new record is added.


Exactly, That's one of the pain area. I would be implementing refresh button on the widget (auto refresh) to refresh the list as watch is not going to work here!!