Mans,
I had to create a matrix of certain size. I did it by using two arrays
(aspects and stages) and writing each column using Erics method (does it
have a name?) of pushing items into a another array 'Out'.
I think it might be a very messy way of doing it, but i've included my code
below.
<script>
var out = [];
var Aspects=["Operations: ","Co-ordination: ","Resource & Performance
Delivery: ","Monitoring: ","Development: ","Managing Strategy: "];
var Stages= ["Capacity","Connectivity","Balance","Consciousness"];
for(var i = 0; i < Stages.length; i++) {
var col1 = ("| @@color(#0044BB):"+Stages[i]+"@@");
var a=0;
var score=DataTiddler.getData(Questions[i],"score");
var col2 = (' | [['+score+'|'+Aspects[a]+Stages[i]+']]');
var a=1;
var j = i+4;
var score=DataTiddler.getData(Questions[j],"score");
var col3 = (' | [['+score+'|'+Aspects[a]+Stages[i]+']]');
var a=2;
var j = j+4;
var score=DataTiddler.getData(Questions[j],"score");
var col4 = (' | [['+score+'|'+Aspects[a]+Stages[i]+']]');
var a=3;
var j = j+4;
var score=DataTiddler.getData(Questions[j],"score");
var col5 = ( ' | [['+score+'|'+Aspects[a]+Stages[i]+']]');
var a=4;
var j = j+4;
var score=DataTiddler.getData(Questions[j],"score");
var col6 = ( ' | [['+score+'|'+Aspects[a]+Stages[i]+']]');
var a=5;
var j = j+4;
var score=DataTiddler.getData(Questions[j],"score");
var col7 = ( ' | [['+score+'|'+Aspects[a]+Stages[i]+']] |');
var row1 = col1 + col2 + col3 + col4 + col5 + col6 + col7;
out.push(row1);
out.push("|OMM Matrix showing aspects of the OMM and their stages of
maturity|c");
}
out.push("| Aspects & @@color:#0044BB;Stages of Maturity@@ | Operations |
Co-ordination | Resource & Performance Delivery | Monitoring | Development |
Managing Strategy |h");
return out.join('\n');
</script>
2009/8/20 Måns <[email protected]>
>
> I believe I could make 5 tiddlers with the fET producing 5 different
> rows with a selected number of outputs from the same data/fields - and
> then embed the "fETTiddlers in a table "like this:
> |<<tiddler fEt#1>>|<<tiddler fEt#2>>|<<tiddler fEt#3>>|<<tiddler
> fEt#4>>|<<tiddler fEt#5>>|
>
> My only problem is that I don't know how to define fx. (index > 20 AND
> index < 25)? to produce "tiddler fET#5"
>
> YS Måns Mårtensson
>
>
>
> On 20 Aug., 01:34, Måns <[email protected]> wrote:
> > This could also fit the bill:
> > nr1 nr2 nr3 nr4 nr5
> > nr6 nr7 nr8 nr9 nr10
> > nr11 nr12 nr13 nr14 nr15
> > nr16 nr17 nr18 nr19 nr20
> > nr21 nr22 nr23 nr24 nr25
> >
> > On 20 Aug., 01:25, Måns <[email protected]> wrote:
> >
> >
> >
> > > Hi
> > > I'm trying to make a fET, which will write/produce a table with 5 rows
> > > and 5 columns.
> > > This way I can make contactsheets for printout..
> > > How do I do that?
> >
> > > This is my fET:
> > > <<forEachTiddler where 'tiddler.tags.contains
> > > (context.viewerTiddler.title)'
> > > sortBy 'tiddler.fields["title"]'
> > > write
> > > '(index < 25)? " "+(index+1)+" [img(6em+,+)["+store.getValue
> > > (tiddler,"title")+"|"+store.getValue(tiddler,"image")+"]
> > > ["+tiddler.title+"]] \n [["+tiddler.title+"]] \n "+tiddler.fields
> > > ["address"] +" \n" : ""'
> > > begin '""
> > > +" "'
> > > end 'count+" \n"' none '"none yet \n"'>>
> >
> > > I'd like the output to look something like this:
> > > nr1 nr6 nr11 nr16 nr21
> > > nr2 nr7 nr12 nr17 nr22
> > > nr3 nr8 nr13 nr18 nr23
> > > nr4 nr9 nr14 nr19 nr24
> > > nr5 nr10 nr15 nr20 nr25
> >
> > > YS Måns Mårtensson
> >
>
--
http://www.multiurl.com/g/64
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tiddlywiki?hl=en
-~----------~----~----~----~------~----~------~--~---