Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS ui.grid exporter fail to load

I am developing a data backend using AngularJS ui.grid. But it seems that it cannot load ui.grid.exporter module when I attempted to load following the tutorial from http://ui-grid.info/docs/#/tutorial/206_exporting_data.

HTML

<div class="grid" ui-grid="{data: roiTableData, columnDefs: roiCols, enableGridMenu: true, exporterCsvFilename: 'myFile.csv', enableSelectAll: true, onRegisterApi: gridApiFunc}" ui-grid-exporter></div>

JS

var app = angular.module('mainApp', [
    'ngResource',
    'ui.grid',
    'ui.grid.exporter',
    'ui.grid.pinning',
    'ui.grid.resizeColumns'
]).constroller(...);

The export function doesn't show on the grid menu after I refresh the page.

Can anyone help me?

like image 495
Yeqing Zhang Avatar asked Feb 24 '26 00:02

Yeqing Zhang


1 Answers

I had to include the uiGridExporterService as a dependency for the controller which gets loaded.

angular.module('my-app', ['ui.grid', 'ui.grid.exporter'])
.controller('myController', function(uiGridExporterService){
    console.log('successfully loaded myController and uiGridExporterService');
});
like image 182
Gavin Palmer Avatar answered Feb 25 '26 13:02

Gavin Palmer