[tw] Re: bug when calling a csv tiddler in a javascript

2018-04-06 Thread Silverfox
Finally I could achieve what I wanted to do by using getTiddlerText instead 
of getTiddlerData...

Thanks again

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/3e3eb353-5a06-414d-a11b-97c9a7c42a87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: bug when calling a csv tiddler in a javascript

2018-04-06 Thread Silverfox

OK, thanks, I understand better now,..



-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/54750677-efd1-4575-8682-43110c0bbd8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: bug when calling a csv tiddler in a javascript

2018-04-06 Thread Stephan Hradek
What's the "type" of your tiddler?

As you seem to understand JavaScript, have a look at the getTiddler 
definition:

exports.getTiddlerData = function(titleOrTiddler,defaultData) {
var tiddler = titleOrTiddler,
data;
if(!(tiddler instanceof $tw.Tiddler)) {
tiddler = this.getTiddler(tiddler); 
}
if(tiddler && tiddler.fields.text) {
switch(tiddler.fields.type) {
case "application/json":
// JSON tiddler
try {
data = JSON.parse(tiddler.fields.text);
} catch(ex) {
return defaultData;
}
return data;
case "application/x-tiddler-dictionary":
return 
$tw.utils.parseFields(tiddler.fields.text);
}
}
return defaultData;
};


Maybe this clarifies why you cannot access CSV data?

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/636c25a5-9f19-4727-8e80-e832bb885bb5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.