Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9208 > unrolled thread

Type-Ahead Searches in a Manipulate or Dynamic Module

Started byGregory Lypny <gregory.lypny@videotron.ca>
First post2012-03-23 06:33 +0000
Last post2012-03-24 07:03 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Type-Ahead Searches in a Manipulate or Dynamic Module Gregory Lypny <gregory.lypny@videotron.ca> - 2012-03-23 06:33 +0000
    Re: Type-Ahead Searches in a Manipulate or Dynamic Module A Retey <awnl@gmx-topmail.de> - 2012-03-24 07:03 +0000

#9208 — Type-Ahead Searches in a Manipulate or Dynamic Module

FromGregory Lypny <gregory.lypny@videotron.ca>
Date2012-03-23 06:33 +0000
SubjectType-Ahead Searches in a Manipulate or Dynamic Module
Message-ID<jkh5gk$jsv$1@smc.vnet.net>
Hello everyone,

I'm cleaning data and prototyping rudimentary databases in 
Mathematica.  I have a few data arrays, consisting of a few thousand 
lines each.  I'd like to be able to search the arrays for lines 
(lists) containing search strings by typing into a text field and having 
the hits appear as I'm typing the search string, sort of like 
Spotlight on the Mac does.  This may be something as simple as using 
Select within the Manipulate combined with ControlActive.  Has anyone 
tinkered with something like this?

Gregory

[toc] | [next] | [standalone]


#9214

FromA Retey <awnl@gmx-topmail.de>
Date2012-03-24 07:03 +0000
Message-ID<jkjrje$42d$1@smc.vnet.net>
In reply to#9208
Am 23.03.2012 07:33, schrieb Gregory Lypny:
> Hello everyone,
>
> I'm cleaning data and prototyping rudimentary databases in
> Mathematica.  I have a few data arrays, consisting of a few thousand
> lines each.  I'd like to be able to search the arrays for lines
> (lists) containing search strings by typing into a text field and having
> the hits appear as I'm typing the search string, sort of like
> Spotlight on the Mac does.  This may be something as simple as using
> Select within the Manipulate combined with ControlActive.  Has anyone
> tinkered with something like this?

this is not really optimized, but I'd give it a try and see if it will 
just work. It should be simple enough to serve as a starting point for a 
more specialized version:

data={{"hello",1},{"test",2},{"something else",3}};

str="";

InputField[Dynamic[str],String,ContinuousAction->True]

Dynamic[If[StringLength[str]>0,
   Grid[Select[data,StringMatchQ[#[[1]],str~~__]&]],
   ""
]]

the real trick is the ContinuousAction option, everything else should be 
pretty straightforward...

hth,

albert

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web