react-data-table-component icon indicating copy to clipboard operation
react-data-table-component copied to clipboard

Data-Table print and export issues

Open fullstackomar opened this issue 3 years ago • 1 comments

There is a problem in this library where if i used columns like this , the print and export button won't work and i get this error :

Uncaught Error: selector must be a . delimted string eg (my.property)

const columns = [
  {
    name: "No.",
    cell: (a, i) => i + 1,
  },
  {
    name: "username",
    selector: row => row.username,
    sortable: true
  }]

but when i use it like this it works but i get alot of errors in the console :

react_devtools_backend.js:4026 Warning: username is a string based column selector which has been deprecated as of v7 and will be removed in v8. Instead, use a selector function e.g. row => row[field]...

 const columns = [
  {
    name: "No.",
    cell: (a, i) => i + 1,
  },
  {
    name: "username",
    selector: 'username',
    sortable: true
  }]

also another issue that the column No. display as NaN when i try to print or export , anyone fixed this issue before ?

fullstackomar avatar Jul 08 '22 00:07 fullstackomar

i have same issue

mahmoud-ahmed-elqenawey avatar Aug 08 '22 14:08 mahmoud-ahmed-elqenawey