Thanks Eric - that does work in that the table renders, but now I see a popup "rows is null or not an object".
Here's my first attempt - I added the class to the header row. The "out" declaration renders OK, but the headers aren't clickable and I get that popup. This also happens if I add the sortable|k\n line as a standalone line before the rest of the table header. .
<script>
var fmt = '|[[%0]]|%1|%2|%3|%4|%5|\n';
var tag = 'current';
var otcm = 'outcome';
var itnt = 'intent';
var nxt = 'next';
var pr = 'priority';
var lstChg = 'last modified';
var out = '|sortable|k\n|!Item|!Priority|!' + otcm + '|!' + itnt + '|!' + nxt + '|!Last Updated|\n';
var tids=store.sortTiddlers(store.getTaggedTiddlers(tag),'modified').reverse();
for (var i=0; i<tids.length; i++) {
var t=tids[i].title;
var o=store.getTiddlerSlice(t,otcm);
var e=store.getTiddlerSlice(t,itnt);
var n=store.getTiddlerSlice(t,nxt);
var p=store.getTiddlerSlice(t,pr);
var d = tids[i].modified;
out += fmt.format([t,p,o,e,n,d]);
}
out += '|' + tag + ' Dashboard|c';
return out;
The same thing happens if I append it to the out with a line just before the caption as so:
out += '|sortable|k\n';
out += '|' + tag + ' Dashboard|c';
In this version, I added the class to the caption. The table renders OK and there is no popup, but the headers aren't clickable.
! Current by priority
<script>
var tag = 'current';
var otcm = 'outcome';
var itnt = 'intent';
var nxt = 'next';
var pr = 'priority';
var lstChg = 'last modified';
var out = '|!Item|!Priority|!' + otcm + '|!' + itnt + '|!' + nxt + '|!Last Updated|\n';
var fmt = '|[[%0]]|%1|%2|%3|%4|%5|\n';
var tids=store.sortTiddlers(store.getTaggedTiddlers(tag),'modified').reverse();
for (var i=0; i<tids.length; i++) {
var t=tids[i].title;
var o=store.getTiddlerSlice(t,otcm);
var e=store.getTiddlerSlice(t,itnt);
var n=store.getTiddlerSlice(t,nxt);
var p=store.getTiddlerSlice(t,pr);
var d = tids[i].modified;
out += fmt.format([t,p,o,e,n,d]);
}
out += '|' + tag + ' Dashboard|c|sortable|k\n';
return out;
</script>
</script>