- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 07:57 AM
I'm using the 'widget-data-table' embedded in another widget. I'd like to embed two list within my widget.
My issue is I'm getting a duplicate of the second list instead of two different list. I have also tried passing the options directly into the HTML witht the same result.
HTML:
<widget id="widget-data-table" options='data.options1'></widget>
<widget id="widget-data-table" options='data.options2'></widget>
Server Script:
data.options1 = {"table": "x_cio99_ppm_project_demand", "filter": "collaboratorsDYNAMIC90d1921e5f510100a9ad2572f2b477fe"};
data.options2 = {"table": "x_cio99_ppm_project_demand", "filter": ""};
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 08:02 AM
Hello @ColeM
Use the approach which i mention below
HTML :-
<div class="panel">
<div ng-repeat="elem in c.data.elements">
<sp-widget widget="elem"></sp-widget>
</div>
</div>
Server Script :-
var listOptions = [
{
"table":"sc_request",
"display_field":"request",
"filter":"request_state=requested^opened_byDYNAMIC90d1921e5f510100a9ad2572f2b477fe",
"order_direction": "",
"order_by": "sys_created_on",
"sp_page":"nr_sc_request",
"secondary_fields":"request_state,price",
"maximum_entries": 2
},
{
"table":"incident",
"display_field":"number",
"filter":"state=1^opened_byDYNAMIC90d1921e5f510100a9ad2572f2b477fe",
"order_direction": "desc",
"order_by": "sys_created_on",
"sp_page":"nr_sc_request",
"secondary_fields":"state,short_description",
"maximum_entries": 3
}]
data.elements = listOptions.map(function(optionList){
return $sp.getWidget('widget-simple-list', optionList);
});
Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 08:20 AM
Hello @ColeM
Ng-Repeat :- It is an Angular Directive which is used to render the element for repeated number of times.
With the help of object in server script you can create multiple responses(table data in your case.) in form of json in that object, which is calling in HTML rendering side.
Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 08:38 AM
Hello @ColeM
Yes you can call it as Best practices, Usually improper code standards leads to un-neccessary re-renders into the client side, which is the cause of your problem.
As per new community rules, you can mark multiple response as Accept, it will help future member to read all valueable responses.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 08:38 AM
Hello @ColeM
Yes you can call it as Best practices, Usually improper code standards leads to un-neccessary re-renders into the client side, which is the cause of your problem.
As per new community rules, you can mark multiple response as Accept, it will help future member to read all valueable responses.
Regards,
Samaksh