meteor-admin icon indicating copy to clipboard operation
meteor-admin copied to clipboard

Search/sort within collection helper results in data table

Open brylie opened this issue 10 years ago • 9 comments

When displaying the data table from any collection, the search field only seems to operate on visible fields from the current collection. I.e. any data displayed from collection helpers may not be searched, even though it may be visible in the data table.

E.g. in the following code, the generated data table will only search within the title field/column.

tableColumns: [
  {label: "Title", name: "title"},
  {label: "Helper", name: "collectionHelper()"}
]

brylie avatar Jun 22 '15 07:06 brylie

Virtual fields cannot be searched through the database. One possible solutions is to provide a hook for changeSelector callback.

mpowaga avatar Jun 22 '15 13:06 mpowaga

Alright, I am a bit unclear on how to use the changeSelector callback.

brylie avatar Jun 23 '15 12:06 brylie

Yeah, I'm in the same boat, would love some idiot-proof example of how to do this after following that link and feeling inadequate...

mordrax avatar Jun 25 '15 07:06 mordrax

I wasn't clear enough. I meant that it should be possible to define custom changeSelector callback. But that's not possible yet.

mpowaga avatar Jun 25 '15 11:06 mpowaga

OK, thanks for the clarification. This is a really important feature for a project that I am working on. We have a collection uses three collection helpers, linking to and/or formatting data that are of primary importance. When users view the submissions for the primary collection, they will reflexively use the search field expecting to filter for results from the relationship collection helpers.

brylie avatar Jun 25 '15 19:06 brylie

+1, "[Column] - (Not searchable)" isn't going to go down well with users hehe

mordrax avatar Jun 26 '15 01:06 mordrax

There are two open issues related to this issue on the aldeed:tabular repository:

  • https://github.com/aldeed/meteor-tabular/issues/114
  • https://github.com/aldeed/meteor-tabular/issues/151

brylie avatar Jun 28 '15 15:06 brylie

+1. Anyone got any type of workaround for this yet?

niranjans avatar Jul 19 '16 15:07 niranjans

+1

webmagnets avatar Nov 06 '16 15:11 webmagnets