How to pass data to server in widget on click of tabs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2016 12:16 AM
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.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2016 08:50 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2016 10:34 PM
Does your approach break the browser history (back button)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2016 12:08 AM
No..Everything is working fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2016 12:20 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2016 01:27 AM
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!!