2

I am using ag-grid for data grid in Angularjs application but it does not work. It does not even throw any error. Below is my export function -

exportData: function() {
        var vm = this;
        var params = {
            fileName : vm.pageTitle + '.csv',
            processCellCallback : function(params) { 
            console.log(params.value);
             if (params.value && params.value.toUpperCase) {
                    return params.value.toUpperCase();
                } else {
                    return params.value;
                }
            }
        };
        vm.gridOptions.api.exportDataAsCsv(params);     
    }

Below are the versions I am using -

Angular : 1.5.0

Ag-grid : 2.3.5

Thanks in advance for any help.

1 Answer 1

1

Ag-grid : 2.3.5

There is your problem... the Docs are constantly updated for the most recent release. You are using 2 year old technology and trying to use the most recent features. Here is the Github repo for your release:

https://github.com/ceolter/ag-grid/tree/2.3.5

You can look through there to find the docs of what is available to you... or you could upgrade to the most recent release.


For convenience sake here are the only params available to you if you remain on 2.3.5:

  • skipHeader: Set to true if you don't want to first line to be the column header names.
  • skipGroups: Set to true to skip headers and footers if grouping. No impact if not grouping.
  • skipFooters: Set to true to skip footers only if grouping. No impact if not grouping or if not using footers in grouping.
  • fileName: String to use as the file name. If missing, the file name 'export.csv' will be used.
  • customHeader: If you want to put some text at the top of the csv file, stick it here. You will need to include '\n' at the end, or many '\n' if you want the header to span lines..
  • customFooter: Same as customHeader, but for the end of the file.
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a lot @Jarod. I will upgrate the ag-grid version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.