Skip to content

Commit 2f5ac87

Browse files
Portugal, Marcelomportuga
Portugal, Marcelo
authored andcommitted
fix(build): Fixing gridMenu undefined error.
Also, fixing ui-grid-importer implementation on tutorial 401.
1 parent 724df35 commit 2f5ac87

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

misc/tutorial/401_AllFeatures.ngdoc

+6-3
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ All features are enabled to get an idea of performance
2828
fastWatch: true,
2929
rowIdentity: getRowId,
3030
getRowIdentity: getRowId,
31+
importerDataAddCallback: function importerDataAddCallback( grid, newObjects ) {
32+
$scope.myData = $scope.data.concat( newObjects );
33+
},
3134
columnDefs: [
3235
{ name:'id', width:50 },
3336
{ name:'name', width:100 },
34-
{ name:'age', width:100, enableCellEdit: true, aggregationType:uiGridConstants.aggregationTypes.avg, treeAggregationType: uiGridGroupingConstants.aggregation.AVG },
37+
{ name:'age', width:100, enableCellEdit: true, aggregationType: uiGridConstants.aggregationTypes.avg, treeAggregationType: uiGridGroupingConstants.aggregation.AVG },
3538
{ name:'address.street', width:150, enableCellEdit: true },
3639
{ name:'address.city', width:150, enableCellEdit: true },
3740
{ name:'address.state', width:50, enableCellEdit: true },
@@ -45,8 +48,8 @@ All features are enabled to get an idea of performance
4548
{ name:'friends[2].name', displayName:'3rd friend', width:150, enableCellEdit: true },
4649
{ name:'agetemplate',field:'age', width:150, cellTemplate: '<div class="ui-grid-cell-contents"><span>Age 2:{{COL_FIELD}}</span></div>' },
4750
{ name:'Is Active',field:'isActive', width:150, type:'boolean' },
48-
{ name:'Join Date',field:'registered', cellFilter:'date', width:150, type:'date', enableFiltering:false },
49-
{ name:'Month Joined',field:'registered', cellFilter: 'date:"MMMM"', filterCellFiltered:true, sortCellFiltered:true, width:150, type:'date' }
51+
{ name:'Join Date',field:'registered', cellFilter:'date', width:150, type:'date', enableFiltering: false },
52+
{ name:'Month Joined',field:'registered', cellFilter: 'date:"MMMM"', filterCellFiltered: true, sortCellFiltered: true, width:150, type:'date' }
5053
],
5154
onRegisterApi: function onRegisterApi(registeredApi) {
5255
gridApi = registeredApi;

src/features/exporter/js/exporter.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -559,62 +559,62 @@
559559
{
560560
title: i18nService.getSafeText('gridMenu.exporterAllAsCsv'),
561561
action: function ($event) {
562-
this.grid.api.exporter.csvExport( uiGridExporterConstants.ALL, uiGridExporterConstants.ALL );
562+
grid.api.exporter.csvExport( uiGridExporterConstants.ALL, uiGridExporterConstants.ALL );
563563
},
564564
shown: function() {
565-
return this.grid.options.exporterMenuCsv && this.grid.options.exporterMenuAllData;
565+
return grid.options.exporterMenuCsv && grid.options.exporterMenuAllData;
566566
},
567567
order: grid.options.exporterMenuItemOrder
568568
},
569569
{
570570
title: i18nService.getSafeText('gridMenu.exporterVisibleAsCsv'),
571571
action: function ($event) {
572-
this.grid.api.exporter.csvExport( uiGridExporterConstants.VISIBLE, uiGridExporterConstants.VISIBLE );
572+
grid.api.exporter.csvExport( uiGridExporterConstants.VISIBLE, uiGridExporterConstants.VISIBLE );
573573
},
574574
shown: function() {
575-
return this.grid.options.exporterMenuCsv && this.grid.options.exporterMenuVisibleData;
575+
return grid.options.exporterMenuCsv && grid.options.exporterMenuVisibleData;
576576
},
577577
order: grid.options.exporterMenuItemOrder + 1
578578
},
579579
{
580580
title: i18nService.getSafeText('gridMenu.exporterSelectedAsCsv'),
581581
action: function ($event) {
582-
this.grid.api.exporter.csvExport( uiGridExporterConstants.SELECTED, uiGridExporterConstants.VISIBLE );
582+
grid.api.exporter.csvExport( uiGridExporterConstants.SELECTED, uiGridExporterConstants.VISIBLE );
583583
},
584584
shown: function() {
585-
return this.grid.options.exporterMenuCsv && this.grid.options.exporterMenuSelectedData &&
586-
( this.grid.api.selection && this.grid.api.selection.getSelectedRows().length > 0 );
585+
return grid.options.exporterMenuCsv && grid.options.exporterMenuSelectedData &&
586+
( grid.api.selection && grid.api.selection.getSelectedRows().length > 0 );
587587
},
588588
order: grid.options.exporterMenuItemOrder + 2
589589
},
590590
{
591591
title: i18nService.getSafeText('gridMenu.exporterAllAsPdf'),
592592
action: function ($event) {
593-
this.grid.api.exporter.pdfExport( uiGridExporterConstants.ALL, uiGridExporterConstants.ALL );
593+
grid.api.exporter.pdfExport( uiGridExporterConstants.ALL, uiGridExporterConstants.ALL );
594594
},
595595
shown: function() {
596-
return this.grid.options.exporterMenuPdf && this.grid.options.exporterMenuAllData;
596+
return grid.options.exporterMenuPdf && grid.options.exporterMenuAllData;
597597
},
598598
order: grid.options.exporterMenuItemOrder + 3
599599
},
600600
{
601601
title: i18nService.getSafeText('gridMenu.exporterVisibleAsPdf'),
602602
action: function ($event) {
603-
this.grid.api.exporter.pdfExport( uiGridExporterConstants.VISIBLE, uiGridExporterConstants.VISIBLE );
603+
grid.api.exporter.pdfExport( uiGridExporterConstants.VISIBLE, uiGridExporterConstants.VISIBLE );
604604
},
605605
shown: function() {
606-
return this.grid.options.exporterMenuPdf && this.grid.options.exporterMenuVisibleData;
606+
return grid.options.exporterMenuPdf && grid.options.exporterMenuVisibleData;
607607
},
608608
order: grid.options.exporterMenuItemOrder + 4
609609
},
610610
{
611611
title: i18nService.getSafeText('gridMenu.exporterSelectedAsPdf'),
612612
action: function ($event) {
613-
this.grid.api.exporter.pdfExport( uiGridExporterConstants.SELECTED, uiGridExporterConstants.VISIBLE );
613+
grid.api.exporter.pdfExport( uiGridExporterConstants.SELECTED, uiGridExporterConstants.VISIBLE );
614614
},
615615
shown: function() {
616-
return this.grid.options.exporterMenuPdf && this.grid.options.exporterMenuSelectedData &&
617-
( this.grid.api.selection && this.grid.api.selection.getSelectedRows().length > 0 );
616+
return grid.options.exporterMenuPdf && grid.options.exporterMenuSelectedData &&
617+
( grid.api.selection && grid.api.selection.getSelectedRows().length > 0 );
618618
},
619619
order: grid.options.exporterMenuItemOrder + 5
620620
}

0 commit comments

Comments
 (0)