In message <[email protected]> on
Tue, 24 Jun 2014, Eric Shulman <[email protected]> writes
>I am looking in to your other problem (showing characters, regardless
>of activities)... It's been a while since I've look through the
>GridPlugin code, so I'm not sure if it's a bug, or a usage issue.  I
>have to set up a test document to try your minimal sample data so I can
>understand exactly what the problem is and then determine a suitable
>fix or workaround.

I think I have identified the problem, it's the fake slice to show the
number of bytes in a tiddler.

Since getSlices always returns at least 'TiddlerSize', every tiddler is
added as a row in getRowsAndCols.

What getRowsAndCols needs to do is only add the row if it either
contains at least one named slice or no slice names are defined.

So, what I did was add a function:

  isSliceInNames: function(s, names) {
    //console.log("s: " + s);
    if (names.length) {
      for (var k=0; k<names.length; k++) {
        if ( s === names[k] ) {
          //console.log("s2: " + s);
          return true;
        }
      }
    } else { // If no slice names are specified, all are valid.
      //console.log("s1: " + s);
      return true;
    }
    return false;
  },

Then replace the line:

  var include=false; for (var s in slices) {
    cols.pushUnique(s); include=true;
  }

in getRowsAndCols with:

  var include=false; for (var s in slices) {
    if (this.isSliceInNames(s, names)) {
      cols.pushUnique(s); include=true;
    }
  }

I'm sure there is a better way of doing this, but this is working for me
for now.

Take care,


Mark..........
-- 
Mark Booth

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to