Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

processCellCallback #1229

Closed
mrjumpy opened this issue Oct 30, 2016 · 5 comments
Closed

processCellCallback #1229

mrjumpy opened this issue Oct 30, 2016 · 5 comments

Comments

@mrjumpy
Copy link

mrjumpy commented Oct 30, 2016

I have a column and its format is phone number, like 09xxx
as you can see, there's leading zero there.
I use lodash pad, to let phone number to be 09xxx, not just String(phone) => 9xxx
and =>


switch (param.column.colId) {
  case 'phone': {
    return  _pad(param.value) ;
  }
  default: {
    return param.value;
  }
}

}```


but the format still number.. when i export.
is it a bug?

thanks
@alhweiti
Copy link

First, open the file in text editor, and see if it has zeros, because excel might be processing your data and changing it (by removing leading zeros)..
If in text editor, zeros are not there, then it's an export issue. I dealt with something similar, basically:
If you use valuegetter to format data, that will affect your exported data, so use that function.
For your information, in case you don't want the exported data to have certain stuff(like if you have a column with links and you want to only show the text not the whole href tag) then use cellRenderer, instead of valuegetter.

Hope it helps.

Ahlam

@mrjumpy
Copy link
Author

mrjumpy commented Oct 30, 2016

thanks
I found that there's a leading zero in csv file. But after export, still not show zero QQ
So, is it excel problem? not ag-grid

@alhweiti
Copy link

Yes. It's excel then..

@alhweiti
Copy link

Try wrapping it in double quotes , maybe that will make excel keep the leading zero..

@ceolter
Copy link
Contributor

ceolter commented Oct 31, 2016

yes it's excel, so closing this issue. thanks @alhweiti

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants