% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/filter_data_list.R
\name{filter_data_list}
\alias{filter_data_list}
\title{Filter Data List Column}
\usage{
filter_data_list(table_id, style = "width: 100\%; height: 28px;")
}
\arguments{
\item{table_id}{'character' string.
Unique identifier of the table the filter belongs to. Must match the \code{elementId}
given to the table so that \code{Reactable.setFilter()} can target it.}

\item{style}{'character' string.
CSS applied to the text input element. Defaults to a full-width, 28px-tall box.}
}
\value{
Returns a function of two arguments, \code{values} (the column's values) and
\code{name} (the column name), which returns an \pkg{htmltools} tag list for the
filter input.
}
\description{
Create a column filter for a \pkg{reactable} table that pairs a text
input with an HTML \code{datalist}, giving users autocomplete suggestions drawn from
the column's unique values.
Requires that the \pkg{htmltools} package is available.
}
\details{
The returned function is intended for use as a column's \code{filterInput} in
\code{\link[reactable:colDef]{reactable::colDef()}}. When rendered, it produces a text box backed by a
\code{datalist} of the sorted unique values in that column; typing filters the table
via \code{Reactable.setFilter()}, while the suggestions assist exact matches.
}
\examples{
f <- filter_data_list("table-id")
}
\references{
Adapted from the \pkg{reactable} "Custom Filtering" vignette
(\url{https://github.com/glin/reactable/blob/HEAD/vignettes/custom-filtering.Rmd}),
by Greg Lin and Tanner Linsley, 2019 (MIT License). Accessed 2024-05-30.
}
\author{
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
}
\keyword{internal}
