Skip to content

Conversation

@itsmicaio
Copy link

This PR adds possibility to customize columns.

how to use:

  • create array of columns:
const exportColumns = [
  {
    name: 'coupon',
    key: 'code', // key of record param
    callback: (value: string) => `30#${value}`, // optional callback to transform data
  },
  {
    name: 'name',
    concat: { // concat a list of record params by param key
      keys: ['firstName', 'lastName'],
      separator: ' ',
    },
  },
  {
    name: 'products',
    concat: { // concat an array record param
      key: 'products',
      separator: ', ',
    },
  }
]
  • add options to feature builder
const adminJsOptions = {
...
    features: [
      importExportFeature({
        export: {
          columns: exportColumns
        },
        import: {
          isVisible: false
        }
      })
    ],
...
}

@itsmicaio itsmicaio marked this pull request as ready for review January 19, 2023 19:21
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

Successfully merging this pull request may close these issues.

1 participant