On Thursday, December 12, 2019 at 1:02:19 PM UTC-8, Mohammad wrote:
>
> I am EXPERIMENTING how to implement a searchable dynamic table in Shiraz!
>
> My top priorities are
>
>    - *modular design (extensible)*
>    - *minimalist design*
>       - *simple to use*
>       - *simple to understand*
>    
> Today we had a fruitful thread with Eric Shulman who created a simple 
> powerful UI to search and destroy!
> https://groups.google.com/d/msg/tiddlywiki/OeVzRs9FeYo/BNNRK5hEBgAJ
> I used his design and approach with some minor changes and used it with 
> *table-fd* the dynamic table builder from fields in Shiraz plugin.
> I have pushed an *EXPERIMENTAL *update and setup a wiki on tiddlyspot to 
> get feedback!
> http://tw-tables.tiddlyspot.com/
> Now we have searchable dynamic table builder!
>

I did a little experiment myself, to combine my latest version of 
"PowerSearch" (renamed from SearchAndDestroy) with the dynamic table output 
from Shiraz.

Here's what I did:
1) From http://tiddlytools.com/filtergenerators.html, import these tiddlers 
(drag-and-drop from the sidebar list)
* TiddlyTools/FilterGenerators/PowerSearch
* TiddlyTools/Macros/edit-list
since these are just macro definitions, there's no plugins involved and 
they can be used right away, without needing to save-and-reload.

2) Create a new tiddler containing:
\import TiddlyTools/FilterGenerators/PowerSearch

\define doSearch_showresults()
<$macrocall $name=table-fd 
 filter=<<filter>> tblClass="" 
 fields="tbl-expand title fa fb fc caption tags" 
 stateTiddler=n 
 tblCaption="''Table 2. Dynamic table example''"/>
\end

\define getOptions() <!-- NO DISPLAY OPTIONS -->

<<setStyles>>
<<getInputs>>
<$vars
  tids={{{ [<tidinput>get[text]]   ~[[tiddlers]]        }}}
   pre={{{ [<preinput>get[text]]                        }}}
   tag={{{ [<taginput>get[text]]                        }}}
 field={{{ [<fieldinput>get[text]] ~[[title,text,tags]] }}}
  flag={{{ [<flaginput>get[text]]  ~[[words]]           }}}
  term={{{ [<terminput>get[text]]                       }}}
  sort={{{ [<sortinput>get[text]]  ~[[title]]           }}}>
   <<doSearch>>
</$vars>

What it does:
1) import all the macros from PowerSearch
2) override doSearch_showresults() to invoke the "table-fd" macro call
    (note: use filter=<<filter>> instead of filter=<<uifilter>>)
3) override getOptions() button to remove the button and popup
    (note: they only apply to the default PowerSearch "showresults()" 
output)
4) get the inputs and do the search
   (same as the PowerSearch code)

note that I don't apply your styles to the inputs, since the edit-list 
display
relies upon overlapping of edit-text and select controls, which wouldn't
look right if you change the input control styles.

The result: my latest search input interface, with the Shiraz table output!

enjoy,
-e

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/10dfb4db-04cd-4ca2-bf50-f4f76af7be55%40googlegroups.com.

Reply via email to