coreui-react icon indicating copy to clipboard operation
coreui-react copied to clipboard

CSmartTable CoreUI 4.1.2 pro custom column filters.

Open cossminuu opened this issue 4 years ago • 15 comments

Hello,

Not really a feature request because maybe already exists but doesn't make sense to post it in the "issues" section.

Can someone tell me please if it's possible to add custom column filters?

Screenshot 2022-02-10 083305

Instead of the default one (search input), to add something custom like a "date picker" or a dropdown.

If I'm not wrong, it was possible in a previous version.

Thank you.

cossminuu avatar Feb 10 '22 08:02 cossminuu

@cossminuu we're going to add more filter options in future releases. We will add select, multi-select, and this new component https://coreui.io/react/docs/4.1/forms/date-range-picker/

mrholek avatar Feb 10 '22 12:02 mrholek

@mrholek An approximate future date? If it's possible

Based on the date, I have to decide if need to create them on my own.

Thanks

cossminuu avatar Feb 10 '22 12:02 cossminuu

@cossminuu I will do my best to release it in the first half of next month.

mrholek avatar Feb 10 '22 12:02 mrholek

Ok. Thank you @mrholek

cossminuu avatar Feb 10 '22 12:02 cossminuu

@mrholek please take in account also a time picker and date-time picker. Thanks!

MatteoBuffo avatar Feb 10 '22 14:02 MatteoBuffo

@mrholek Any news about this? thanks

cossminuu avatar Mar 15 '22 09:03 cossminuu

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

github-actions[bot] avatar May 14 '22 14:05 github-actions[bot]

Hi @mrholek! Now that the new filters have been added in version 4.2.1, how do you make use of them in a CSmartTable?

MatteoBuffo avatar May 17 '22 07:05 MatteoBuffo

@MatteoBuffo they added this?

cossminuu avatar Jun 14 '22 09:06 cossminuu

@cossminuu not yet, @mrholek is currently working on it and he will make it available in the next release.

MatteoBuffo avatar Jun 14 '22 09:06 MatteoBuffo

Any update on this issue and when it will be resolved?

sergiofcpaulino avatar Jul 08 '22 08:07 sergiofcpaulino

@sergiofcpaulino It's almost done, I have to update the documentation, and check it one more time. I'm going to release a new version next week.

mrholek avatar Jul 08 '22 09:07 mrholek

Added in v4.4.0 - https://coreui.io/react/docs/components/smart-table/#custom-filters

mrholek avatar Jul 30 '22 11:07 mrholek

@mrholek Seems like custom filters don't work in combination with external data sources, any plans on implementing or fixing that in the near future?

karlobencic avatar May 17 '23 20:05 karlobencic

I used dropdown for custom filter with external data source like this

{
        key: 'type_asset',
        label: 'Type',
        filter: (value, change) => {
            const dropdownOptions = props.assetTypeTaxonomy

            return h(CFormSelect, {
                size: 'sm',
                onChange: (selected) => {
                    change(selected.target.value)
                },
                options: [
                    { value: '', label: 'All' },
                    ...dropdownOptions.map((element) => {
                        return {
                            value: element.term_id,
                            label: element.name,
                        }
                    })
                ],
            })
        },
    },

mudassir1996 avatar Feb 21 '25 18:02 mudassir1996