columnify icon indicating copy to clipboard operation
columnify copied to clipboard

It will be more convenient if an extra param such as 'key' be added to dataTransform

Open hustcer opened this issue 9 years ago • 4 comments

Hi, Thanks for the great work, and I think It will be more convenient if an extra param such as 'key' be added to dataTransform, sometimes we need to transform data according to which key current data is.

hustcer avatar Jan 11 '16 09:01 hustcer

@hustcer good idea, you can get it from reading the name property of the second argument to the dataTransform. This isn't documented though, so my bad. If you get this working, think you could send a docs PR?

timoxley avatar Jan 29 '16 02:01 timoxley

I have tried and the second argument just displays nothing but {}, I got no key name? Is there anything wrong?

hustcer avatar Jan 29 '16 04:01 hustcer

@hustcer @timoxley The same was happening with me... I added a PR that adds a 4th param called columnName not sure if this should be closed if theres some other fixed needed with the second argument?

kmgilbert100 avatar Mar 28 '16 20:03 kmgilbert100

@timoxley Looks like in the data you have to specify a name key to populate that column object? If you look at the example in my pr its how I am attempting to accomplish.. hoping can get that merged soon so I can pull it in from master to my project .. got it setup via npm link working exactly how I need it.. very useful feature :)

kmgilbert100 avatar Mar 28 '16 20:03 kmgilbert100