Service Portal : Data is not populated when calling data table widget in another widget

raja_5
Tera Expert

Hi Experts,

 

I am trying to call the 'ABC' data table widget in "XYZ"widget when clicking on a tab in 'XYZ' widget 

Widget "ABC" preview attached : data table widget  (Expected looks and feel)

but when calling 'ABC' in 'XYZ' it doesn't show me the data

 

Current look feel: screenshot attached no data.PNG

 

Widget XYZ details below

HTML :

<sp-widget widget="c.data.example"></sp-widget>

 

 

Server script :

(function() 
{
    data.tabList = [
{name : gs.getMessage('Roles and Permission'), tab_id: 'RolesandPermission'}];
    data.example = $sp.getWidget('ABC', {});
    })();

NOTE: followed steps from below URL,
 
 
Though it shows me the complete data, But when I add filter condition it doesn't apply on the data shown
 
Kindly suggest.
 
Thank you!
1 ACCEPTED SOLUTION

Hi @raja_5 1]  Can you try to pass existing data-table widget in below line.
data.example = $sp.getWidget('widget-data-table', data);

 

2] Also add data.enable_filter = true;  line above the 'data.filter=options.filter;' line.

Could you please share your widget snippet, In my case it is look likes this

Sonu_Parab_0-1678294807213.png

 

 

are the records are displays on widget the only issue is that Breadcrumbs right?

View solution in original post

16 REPLIES 16

Hi @raja_5 , Thank you for the sharing the script.-->I observed your script, Have you merge both the widgets Data Table[widget-data-table] and 
Filter Breadcrumbs [widget-filter-breadcrumbs] widgets script in one widget?

--> Also from where you are passing the table name ?
-->
Are you calling above widget from any other widget? 

-->Here in my case I have created one separate widget to pass the data.table , and data.filter

    and call the 'data-table' widget. 

Sonu_Parab_0-1678289648279.png

 

Thank you.

 

 

Hi @Sonu Parab 

 

1,  I had to merge Data Table[widget-data-table] and 
Filter Breadcrumbs [widget-filter-breadcrumbs] as it was not working as expected when calling from widget

2,---------Below function is in main widget where the table is given-----

(function() {
    data.table = "sys_user_has_role";
    data.fields = options.field_list;
    data.o=options.o;
    data.d= options.d;
    data.filter=options.filter;
    data.window_size=options.window_size;
    data.view = options.view;
    data.useInstanceTitle = true// to make sure Data Table widget uses headerTitle always
    data.headerTitle = options.title;
    data.show_breadcrumbs=true;

    data.tabList = [{
        name: gs.getMessage('Roles and Permission'),
        tab_id: 'RolesandPermission'
    }];

     data.example = $sp.getWidget('roles_per',data);
    
})
 
 
3, Yes Iam calling the above widget in the main widget

Hi @raja_5 1]  Can you try to pass existing data-table widget in below line.
data.example = $sp.getWidget('widget-data-table', data);

 

2] Also add data.enable_filter = true;  line above the 'data.filter=options.filter;' line.

Could you please share your widget snippet, In my case it is look likes this

Sonu_Parab_0-1678294807213.png

 

 

are the records are displays on widget the only issue is that Breadcrumbs right?

Hi @Sonu Parab 

Can see the list of records now and able to apply the filer also . but, breadcrumbs is the issue now 

 

 

Hi @raja_5 , Do the changes mention above thread in point 1 and 2 .

and let us know.