Forward and Reverse filtering a List field

Mark Stuart mstuart at adaptcrm.com
Fri Jun 18 15:42:46 CDT 2010


Hi All,

Platform: WinXP
revStudio: 4.0

I'm building an app that populates SQL Server data into a list field
that is defined as a table.
The table data delimiter is the tab char.
All this works fine.

I'd like to build a filter system for the table data.

The list would be "filtered" by typing a value into any column filter
field, which is placed above each column.
So if there are 4 columns, then there are 4 filter fields, having the
possibility of an accumulative filter.

Typing into or editing a filter field will filter the list for each
character typed. Including backspacing a character or deleting any
existing character.

I've already built a prototype for this, and when typing a filter, the
script works OK.
In the "on rawKeyDown" handler, I first put the table data into a local
variable and filter on it. Then put the variable back into the field.
These ideas I got from searching the archive list.
Problem is when I backspace a filter field character (conceptually
reverting the filter), the data is not there, as it has already been
filtered and put back into the field. Resulting in an incorrect data
set.

Question: so how do I build a filter system that can filter "forward"
(typing ahead) and filter in "reverse" (editing existing filter value or
"filter revert")?


Regards,
Mark Stuart



More information about the use-livecode mailing list