hjalmers / angular-generic-table

A generic table for Angular 2+. Generic table uses standard markup for tables ie. table, tr and td elements etc. and has support for expanding rows, global search, filters, sorting, pagination, export to CSV, column clicks, custom column rendering, custom export values.
https://hjalmers.github.io/angular-generic-table/
MIT License
105 stars 55 forks source link

add an image on each cell #180

Open sahilkatia opened 6 years ago

sahilkatia commented 6 years ago

Hi,

I am trying to add an image/icon on . Please see the below picture for reference. Also, I am trying to add search on each column like in the picture Can we achieve that features with angular-generic-table? image

hjalmers commented 6 years ago

Hi @sahilkatia generic-table is built to be flexible so most things are possible although some things might require some tinkering and a creative mindset. I guess there might be use cases were users might want to search in columns individually but from a UX perspective I would probably suggest using global search together with fixed filters for individual columns. Consider the following table:

Name Gender Country Profession
Anna Female Germany Designer
Peter Male France Painter
Carl Male Sweden Carpenter

It's always nice with the option to do a free text search, but if users want to find people from a certain country or with some specific profession, free text might not be the best option as we should know all the possible values and it would be even better if we could help users filter the table using these values. For gender it makes more sense to display a multi-select dropdown than providing a free text search, for countries maybe a multi-select with all the countries and for professions displaying an input field with type-ahead could be a nice option. If a users types "car" the type-ahead component would only display Carpenter and once selected we could pass this value as a filter rather than a free-text search.

I thought about this before and global search as it works right now will search all columns except columns marked as not searchable. The filter functionality is pretty basic right now but the idea is to enable own filter functions such as. Greater than , Less than, Equal to, Contains etc. which could be used for your use case too.

So the answer is both yeas and no. You should be able to do something similar but it would take some tinkering as it's not available out of the box right now.