Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9208 > unrolled thread
| Started by | Gregory Lypny <gregory.lypny@videotron.ca> |
|---|---|
| First post | 2012-03-23 06:33 +0000 |
| Last post | 2012-03-24 07:03 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
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
| From | Gregory Lypny <gregory.lypny@videotron.ca> |
|---|---|
| Date | 2012-03-23 06:33 +0000 |
| Subject | Type-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]
| From | A Retey <awnl@gmx-topmail.de> |
|---|---|
| Date | 2012-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