Smart View WebReports widget

Hi

We have a landing page with 3 tabs - overview, documents, statistics

In overview page we have Widget 1 (WebReport)

In statistics we have Widget 2 (WebReport)

Both widget use code similar to this

<div id="content"></div>

<script>
csui.require([
	'csui/lib/marionette',
	'csui/lib/jquery',
	'csui/utils/contexts/page/page.context',
	'csui/utils/contexts/factories/connector',
	'webreports/controls/table.report/table.report.view'
], function (
	Marionette,
	$,
	PageContext,
	ConnectorFactory,
	TableReportView) {

	var	contentRegionDP = new Marionette.Region({el: '#content'}),
			pageContextDP = new PageContext(),
			tableReportViewDP,
			options;

	options = {
		context: pageContextDP,
			data: {
				id: [LL_REPTAG_$WRDATA /],
				title: 'Document progress',
				header: false,
				titleBarIcon: 'title-assignments',
				columnsWithSearch: ["Name","Progress"],
				sortBy: 'Name',
				sortOrder: 'asc'
			}
	};

	tableReportViewDP = new TableReportView(options);
	contentRegionDP.show(tableReportViewDP);
	pageContextDP.fetch();

});
</script>


Problem is that when switching between tabs, sometimes these WebReport widget do not load.

Is there other way how to call the tablereport view? maybe re-using same page context or something.

Tagged:

Comments

  • Hi Uldis

    Can you please explain how you created the tabs in SmartView. Some code snips and screenshots will be of great help.

    Thanks

    Vijhay Devarajan.

  • Hi

    Tabs are automatically enabled in Perspective manager when you create landing page for workspaces. From configure workspaces page.

  • I suggest you create an unique ID (instead of just "content"). You can use the subtag that gives you the time ticks or something like that.

    Also, include some debug output around your code (console.log(...)) to help you troubleshoot.


    Hope it helps.

  • Hi Pedre,

    That actually helped. I used unique ID as suffixes for objects and elements

    Thanks