nainglinnkhant / shadcn-view-table

Shadcn table component with server side sorting, pagination, filtering, and custom views. This is built on top of @sadmann17's shadcn-table.
https://view-table.nainglinnkhant.com
175 stars 8 forks source link

Hybrid labels provision #2

Closed vasnt closed 1 month ago

vasnt commented 2 months ago

https://github.com/nocodb/nocodb/issues/8885

nainglinnkhant commented 2 months ago

Assuming you are talking about two fields in one column and it must be filterable, you can build the query as below in the queries.ts file.

const [fieldOneValue, fieldTwoValue] = twoFieldColumn.split('-')

if (fieldOneValue) {
  filterColumn({
    column: tasks.fieldOne,
    value: fieldOneValue,
  })
}

if (fieldTwoValue) {
  filterColumn({
    column: tasks.fieldTwo,
    value: fieldTwoValue,
  })
}