Get your dynamic tables to sort rows by storyTiddler tag/list order!

For tags, I always set up a view template (for when the tag’s name is brought into story river, even if that node is a “missing” tiddler) that shows a dynamic table with rows for each of the tiddlers so tagged.

But — nagging dissatisfaction! — there’s no way (out of the box) to sort that table according to the order of the tiddlers under that tag (as they would appear in the tagpill). So, for $:/tags/Stylesheet — or any of the poweful cascade tiddlers like $:/tags/ViewTemplateBodyFilter — much troubleshooting value is lost. (Update/clarification: @Mohammad seems to have told me that the rows do render in tag-list order by default… I don’t see that. But even if they did, there’s no built-in mechanism to re-establish that list order, once another field-column header is chosen.)

So, I created a custom column template header (with no contents for the body cells). Click on that header (which has the core’s “tag” icon), and your dynamic table will now sort according to the list field of the storyTiddler. Just drag that column-header-template tiddler into your wiki and – provided you also have Shiraz — you can get a sortHere column too!

Link to solution, with demo.

Nice. I think you may a simpler solution than mine. I implemented a template which the text field defines a single row of a table. Then I use a header and footer fields to define those. The header columns too are sortable.

Do you have a footer template for table pagination?

Here’s my example

I’m not sure I follow what is meant by this. I did look at your example and it’s very impressive!

My uses for dynamic tables almost always have me preferring to scroll. Actually, by temperament I usually prefer to scroll rather than click/browse through subsets. Certainly there are interfaces where rendering a whole long list would be disruptive, though! And the pagination buttons you have are quite intuitive.

I think your filter-narrowing searchbox above the dynamic table is excellent, and this kind of thing is perhaps the single most common addition I make to dynamic tables with potentially lengthy results. For end-users (web visitors without TiddlyWiki-insider interests), it makes sense for the input to be a simple string.

For my own uses, I tend to like adding direct access to the whole filter for the dynamic table, and maybe its fields (columns) as well. See, for example dynamic dynamic tables.

I wrote a macro (yeah, I’m eventually going to refactor macros to procedures) called pagination. It accepts a filter and template tiddler, among a few other things. The text field of the template is used to show results of single result from the filter. The header field is used to define the header. This can be anything I need to prefix the list. In some cases it defines the table and header columns of the table. The footer field simply suffixes the list, which would define the closing tags of the table.

The header has to define how columns are sorted too. It is currently a bit ugly, but it works. I want to review your implementation.