- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2017 04:25 PM
Hi All,
I am using the data table widget and am wondering if it is at all possible to have the filter reference a variable, i.e. user input. I am not quite familiar with widgets but I know that javascript can be run in the filter (only server side though). If it is not possible I would need to create it myself and any tips on how to approach that would be great too.
Thanks for any help.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2017 10:58 PM
Hi
The "Data Table" widget is actually not meant to be use directly - it is meant to be embedded in another widget (eg. Data Table form Instance definition and Data Table from URL Definition). This widget will pass the query and control data to the Data Table widget.
So you just make you own "front-end" widget which have the dynamic filter option you need and then pass the data to the embedded Data Table widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2017 02:55 PM
Hi thanks for the reply,
I am unsure as to how exactly use that function. How exactly do I get that response?
Thanks for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2018 09:05 PM
I have tried the above solution. Which format answer has to create.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2017 01:06 AM
Hi - when I update the widget via the client script, i call the server to get data i need for the data model and then I refresh the widget via the spUtil.get.
Maybe you don't need this, you can generate it client side. If you need to call the server you can learn about it here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2018 06:11 AM
Hi,
Thanks for the reply that did the trick. I have one more question if you have the time. When the user chooses a value from the sn-record-picker the data table loads correctly with the right filter. However when the user selects another value from the record the data table does not refresh correctly. It just displays "No records in". All the new values are correctly passed to the server I feel as though the problem is just that the widget has troubles refreshing itself. Do you have any suggestions?
Thanks in advance for any help.
I have tried the below suggesed code from client side it is not working
spUtil.get("widget-data-table", answer).then(function(response) {
c.data.dataTableWidget = response;
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2018 11:45 AM
Hi,
I am also working on the same req. I am passing the filter condition dynamically from "Data table form" widget to "Data table" widget but the filter condition is not passing to "Data Table" widget, It passing a null value. In that widget I see that it's a encoded filter.
Can you help me out how to pass the filter condition dynamically to "Data table" widget.
Thanks in advance.
Regards,
Manideep Nadimpelli.