|
658 | 658 | */
|
659 | 659 | getColumnHeaders: function (grid, colTypes) {
|
660 | 660 | var headers = [];
|
661 |
| - var sourceColumns; |
| 661 | + var columns; |
662 | 662 |
|
663 | 663 | if ( colTypes === uiGridExporterConstants.ALL ){
|
664 |
| - sourceColumns = grid.columns; |
| 664 | + columns = grid.columns; |
665 | 665 | } else {
|
666 |
| - sourceColumns = grid.renderContainers.body.visibleColumnCache.filter( function( column ){ return column.visible; } ); |
| 666 | + columns = grid.renderContainers.body.visibleColumnCache.filter( function( column ){ return column.visible; } ); |
667 | 667 | }
|
668 | 668 |
|
669 |
| - sourceColumns.forEach( function( gridCol, index ) { |
| 669 | + columns.forEach( function( gridCol, index ) { |
670 | 670 | if ( gridCol.colDef.exporterSuppressExport !== true &&
|
671 | 671 | grid.options.exporterSuppressColumns.indexOf( gridCol.name ) === -1 ){
|
672 | 672 | headers.push({
|
|
723 | 723 | */
|
724 | 724 | getData: function (grid, rowTypes, colTypes) {
|
725 | 725 | var data = [];
|
726 |
| - |
727 | 726 | var rows;
|
728 |
| - |
| 727 | + var columns; |
| 728 | + |
729 | 729 | switch ( rowTypes ) {
|
730 | 730 | case uiGridExporterConstants.ALL:
|
731 | 731 | rows = grid.rows;
|
|
741 | 741 | }
|
742 | 742 | break;
|
743 | 743 | }
|
744 |
| - |
| 744 | + |
| 745 | + if ( colTypes === uiGridExporterConstants.ALL ){ |
| 746 | + columns = grid.columns; |
| 747 | + } else { |
| 748 | + columns = grid.renderContainers.body.visibleColumnCache.filter( function( column ){ return column.visible; } ); |
| 749 | + } |
| 750 | + |
745 | 751 | rows.forEach( function( row, index ) {
|
746 | 752 |
|
747 | 753 | if (row.exporterEnableExporting !== false) {
|
748 | 754 | var extractedRow = [];
|
749 |
| - grid.columns.forEach( function( gridCol, index ) { |
| 755 | + |
| 756 | + |
| 757 | + columns.forEach( function( gridCol, index ) { |
750 | 758 | if ( (gridCol.visible || colTypes === uiGridExporterConstants.ALL ) &&
|
751 | 759 | gridCol.colDef.exporterSuppressExport !== true &&
|
752 | 760 | grid.options.exporterSuppressColumns.indexOf( gridCol.name ) === -1 ){
|
|
757 | 765 | extractedRow.push(extractedField);
|
758 | 766 | }
|
759 | 767 | });
|
760 |
| - |
| 768 | + |
761 | 769 | data.push(extractedRow);
|
762 | 770 | }
|
763 | 771 | });
|
764 |
| - |
| 772 | + |
765 | 773 | return data;
|
766 | 774 | },
|
767 | 775 |
|
|
0 commit comments