The CreatorCon Call for Content is officially open! Get started here.

Data-table widget not showing results

Toube1
Tera Expert

Hi,

I'm trying to show data using the data-table widget on my PDI.

I've cloned the OOB data table widget.

The table is a custom table and I'm calling it from the portal widget with options set etc.

The problem is that the widget is visible on the page and the data is there, I have logged the results to the console log so there is 20 rows of data (with selected fields) but the the widget just loads and only shows the menu for exporting data and no actual data rows are shown.

Can't get my head around why the data is not being printed out.

Any ideas?

I'm using admin to test this so it should be a access issue.

find_real_file.png

Br,

Toube

1 ACCEPTED SOLUTION

in HTML

  <div class="row borderLeftRight">
    <div class="col-xs-12 col-md-12" ng-hide="logIsEmpty" style="padding-top: 15px; color: #000; border-top: 1px solid #ddd;">
      <sp-widget widget="data.dataTableWidget"></sp-widget>
    </div>
  </div>

In Server

	var widgetOptions = {
		"table": "u_mountainbikestats",
		"view": "default",
		"p": 1,
		"o": "u_ride_date",
		"d": "desc",
		"filter": "u_bike.u_ownerDYNAMIC"+data.userid,
		"fields": "u_bike,u_ride_date,u_location,u_time,u_km",
		"table_label": "MountainBike Ride Stats",
		"table_plural": "MountainBike Ride Stats",
		"show_breadcrumbs": true,
		"enable_filter": true,
		"filterACLs": true
	};
	data.dataTableWidget = $sp.getWidget('mtb-data-tables', widgetOptions);

View solution in original post

6 REPLIES 6

in HTML

  <div class="row borderLeftRight">
    <div class="col-xs-12 col-md-12" ng-hide="logIsEmpty" style="padding-top: 15px; color: #000; border-top: 1px solid #ddd;">
      <sp-widget widget="data.dataTableWidget"></sp-widget>
    </div>
  </div>

In Server

	var widgetOptions = {
		"table": "u_mountainbikestats",
		"view": "default",
		"p": 1,
		"o": "u_ride_date",
		"d": "desc",
		"filter": "u_bike.u_ownerDYNAMIC"+data.userid,
		"fields": "u_bike,u_ride_date,u_location,u_time,u_km",
		"table_label": "MountainBike Ride Stats",
		"table_plural": "MountainBike Ride Stats",
		"show_breadcrumbs": true,
		"enable_filter": true,
		"filterACLs": true
	};
	data.dataTableWidget = $sp.getWidget('mtb-data-tables', widgetOptions);

Got the solution, adding it as it may be helpful for others. In client script there is code related to server.update() which is making the service script execute for second time unnecessarily, removing that is fixed the data table widget. It is now renders even with the only input.