kishanov / re-frame-datatable

DataTable component for re-frame library
https://kishanov.github.io/re-frame-datatable/
Eclipse Public License 1.0
103 stars 16 forks source link

Allow duplicated columns? #9

Closed gacelita closed 7 years ago

gacelita commented 7 years ago

Hi,

Right now I'm duplicating the id field in my data because I need it for two columns: the "actions" column, which contains buttons that trigger actions (who need to know the ID), and the "id" column, which simply shows the ID.

This is obviously ugly, is there a better way?

Thank you and great job

kishanov commented 7 years ago

Nothing prevents you from specifying non-existent column-key like [:some-action]. Not the most beautiful solution, so in the future version I might add a special keyword or make column-key optional.

gacelita commented 7 years ago

I used a non-existent key (:actions), and the second argument of the custom render function (the whole row) to access the ID.

Thanks!