简体   繁体   中英

How to change the value of a column in export csv format in ui grid?

I am using UI grid export functionality to export all grid columns in .csv format. Some columns values are 'FALSE' or '1' / '0' . My question is How can I change them to some strings in exported file?

using http://ui-grid.info/docs/#!/api/ui.grid.exporter.api:GridOptions you can use exporterFieldCallBack method as below:

  gridOptions.exporterFieldCallback = function ( grid, row, col, value ) {
  if ( col.name === 'status' ) {
    if(value===0)
        value='FALSE';
  }
  return value;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM