Re: Simple Datatable Filter Example
>One common scenario might be to filter a DataTable based on the
> Hmm, no ideas?
distinct values in a given field. For example, if there is a large list of
employees, there might be a select box with the unique last names. One
could then select "Gossmer" to filter the list to all employees named
Gossmer. Likewise, another column might indicate home office, in which
case we could filter for all employees in the "Tuscon" office or the
In either case, the underlying RecordSet would not be replaced, but a
new "filtered" RecordSet created. If the filter is relaxed, then the
original RecordSet could be restored.
Likewise, the select box could be populated from the original
RecordSet. One might be able to mark a column "filterable" in the same
we mark a column "sortable". The system could automatically create a
list of distinct entries by looping through the RecordSet.
I expect that the architecture would be similar to the RowFilter
example, except that instead of using the autocomplete to filter the
rows, we'd apply a simplier test, like the one used to sort columns.
I haven't yet seen an example like this, but I think it could
represent a common use case. It would be certainly worthwhile to post
a "distinct filter" example in the YUI Sandbox or on Planet Yazaar, if
someone were to code it.