1. Assume you have a list of 14 entries
   2. The entries are given through a filter like [range[1, 14]]
   3. It is desired to display three entries all the time
   4. A next button shows the next three entries
      1. If pressing next button several times and you reached the end of 
      list the last three entries are shown!
   5. A prev button shows the previous three entries
      1. If pressing prev button several times and you reached the 
      beginning of list the first three entries are shown!
   6. So, always, any time three entries are visible on the  screen

Question

How to do this?


Partial solution, not works! 

\define test(filter:"[range[1,14]]")
<$vars filter=<<__filter__>> 
 last-item={{{ [list[stateTid]last[]] }}}
 first-item={{{ [list[stateTid]first[]] }}}
 stateTiddler="stateTid"
>

<$button>Prev List
<$action-setfield $tiddler="stateTid" list=""/>
<$action-listops $tiddler=<<stateTiddler>> 
$subfilter="[subfilter<filter>allbefore<first-item>last[3]] 
~[subfilter<filter>first[3]]"/>
</$button>
<$button>Next List
<$action-setfield $tiddler="stateTid" list=""/>
<$action-listops $tiddler=<<stateTiddler>> 
$subfilter="[subfilter<filter>allafter<last-item>limit[3]] 
~[subfilter<filter>last[3]]"/>
</$button>


</$vars>
\end

<<test>>

{{stateTid!!list}}



   - Create a tiddler in https://tiddlywiki.com/prerelease/
   - Copy paste the above code and click on buttons
   - It works but in two cases it show two entries NOT three



Any idea? AND if a simpler solution exist?

--Mohammad
------------------------------
TiddlyWiki Pre-release — 5.1.20-prerelease 
<https://tiddlywiki.com/prerelease/>

-- 
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/78df28bd-4270-4aca-bd5f-c330235c5fec%40googlegroups.com.

Reply via email to