Searching (filtering) data when it's in a control within a cell

Searching (filtering) data when it's in a control within a cell

MichelRMichelR Posts: 4Questions: 2Answers: 0

We use a DataTable that has some editable fields. Some of them are codesets, so we present them as dropdowns. One is a numeric field (input control with type="number").

While researching how to make the column filters dropdowns for those that are codesets, I realized that those columns that contain data that's within a control in the TD (e.g. input and select), the filter doesn't work at all. I assume that the search/filter functionality only looks at data within the TD itself, not within the control that's in the TD (makes sense).

I've done some research and I haven't been able to come across a similar scenario. I was wondering if there's anyway to implement that kind of search/filtering and, if yes, what you be the best way to go about it? I don't want to reinvent the wheel if it's something that's already available. Note that the other columns are not editable and their data is directly in the TD, unlike the editable ones.

Thanks!
Michel

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Yep, you'll need to handle that specifically. This example here shows how to do that for ordering. For the filtering, you'll need to create a custom search, something like what was attempted in this thread (the thread died but it should get you started).

    Colin

  • colincolin Posts: 15,142Questions: 1Answers: 2,586
    Answer ✓

    This thread just came through too that may be of interest.

  • MichelRMichelR Posts: 4Questions: 2Answers: 0

    Thanks for the links, Colin! I'll use those as a starting point. Always nice to have something to build on (I only recently started using DataTables, still have a LOT to learn!)

    Thanks,
    Michel

This discussion has been closed.