I'll try to explain this the best I can. There is a JSON result which separates every paragraph of the text and marks them with 0 or 1 (or even 0.3 etc). The Stringified results on the frontend shows those numbers too. Is there a way to replace these and apply CSS styles based on the value (0, 0.1, or 1)?
the JSON:
RAW:
"content": [
[
0.0,
"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
[]
],
[
0.0,
"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
[]
],
[
1,
"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
[]
]
],
...
What I get in the front end is:
0Lorem ipsum dolor sit amet, consectetur adipiscing elit.0Lorem ipsum dolor sit amet, consectetur adipiscing elit.1Lorem ipsum dolor sit amet, consectetur adipiscing elit.
I should get:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
With 0s and 1s replacedby html (and classes)
You should just be able to map over that content and pull the values out of each item, then render them.
data.content.map((item, i) =>
<p key={i} className={ item[0] < 0.5 ? 'low-value' : 'high-value' }>{ item[1] }</p>
)
Then you can use deconstructing assignment to make this cleaner and give each value a named local variable.
data.content.map(([value, text, array], i) =>
<p key={i} className={ value < 0.5 ? 'low-value' : 'high-value' }>{ text }</p>
)
My Kendo Grid accepts the following json format
{"GetAllStratagyResult":[{"Id":14,"Region":"xxx","Terminal":"NGAY-HG6","Type":1,"VerisonNumber":"5476","VersionDate":"\/Date(1427782421023+0400)\/","VersionName":"Second Version1","content":"<p><span>Lorem ipsum dolor sit amet, consectetuer adipiscing elit<\/span><\/p><p><span>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.<\/span><\/p><p><span>Proin pharetra novnummy pede.<\/span><\/p><p>cccccccccc<\/p>"},{"Id":15,"Region":"yyy","Terminal":"NGAY-HG6","Type":1,"VerisonNumber":"456","VersionDate":"\/Date(1427722608457+0400)\/","VersionName":"Second Version1","content":"Lorem ipsum dolor sit amet, consectetuer adipiscing elit."},{"Id":16,"Region":"zzz","Terminal":"NGAY-HG6","Type":1,"VerisonNumber":"456","VersionDate":"\/Date(1427722395997+0400)\/","VersionName":"Second Version1","content":"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas."}]
but it won't show column value for following json:
{"readexcelbyteResult":"[{\"IFRS\":\"Volume\",\"2001\":\"645645\",\"2002\":\"875\",\"2003\":\"8598\",\"2004\":\"6986\",\"2005\":\"98698\",\"2006\":\"698698\",\"2007\":\"6989698\",\"2008\":\"57487\",\"2009\":\"487487\",\"2010\":\"4875\",\"2011\":\"458\"},{\"IFRS\":\"ipsum \",\"2001\":\"456456\",\"2002\":\"6986\",\"2003\":\"98698\",\"2004\":\"6986\",\"2005\":\"986\",\"2006\":\"98698\",\"2007\":\"698698\",\"2008\":\"6986\",\"2009\":\"98698\",\"2010\":\"69860606\",\"2011\":\"9860\"},{\"IFRS\":\"dolor \",\"2001\":\"366397\",\"2002\":\"4364\",\"2003\":\"98308\",\"2004\":\"467\",\"2005\":\"4086\",\"2006\":\"40874\",\"2007\":\"6487\",\"2008\":\"4984\",\"2009\":\"8749\",\"2010\":\"87598\",\"2011\":\"4874\"},{\"IFRS\":\"amet\",\"2001\":\"646456\",\"2002\":\"875\",\"2003\":\"8598\",\"2004\":\"6986\",\"2005\":\"98698\",\"2006\":\"698698\",\"2007\":\"6989698\",\"2008\":\"57487\",\"2009\":\"487487\",\"2010\":\"4875\",\"2011\":\"458\"},{\"IFRS\":\"consectetuer \",\"2001\":\"645645\",\"2002\":\"6986\",\"2003\":\"98698\",\"2004\":\"6986\",\"2005\":\"986\",\"2006\":\"98698\",\"2007\":\"698698\",\"2008\":\"6986\",\"2009\":\"98698\",\"2010\":\"69860606\",\"2011\":\"9860\"},{\"IFRS\":\"adipiscing \",\"2001\":\"536397\",\"2002\":\"4364\",\"2003\":\"98308\",\"2004\":\"467\",\"2005\":\"4086\",\"2006\":\"40874\",\"2007\":\"6487\",\"2008\":\"4984\",\"2009\":\"8749\",\"2010\":\"87598\",\"2011\":\"4874\"},{\"IFRS\":\"Maecenas \",\"2001\":\"456456\",\"2002\":\"875\",\"2003\":\"8598\",\"2004\":\"6986\",\"2005\":\"98698\",\"2006\":\"698698\",\"2007\":\"6989698\",\"2008\":\"57487\",\"2009\":\"487487\",\"2010\":\"4875\",\"2011\":\"458\"},{\"IFRS\":\"porttitor \",\"2001\":\"564564\",\"2002\":\"6986\",\"2003\":\"98698\",\"2004\":\"6986\",\"2005\":\"986\",\"2006\":\"98698\",\"2007\":\"698698\",\"2008\":\"6986\",\"2009\":\"98698\",\"2010\":\"69860606\",\"2011\":\"9860\"},{\"IFRS\":\"congue \",\"2001\":\"366397\",\"2002\":\"4364\",\"2003\":\"98308\",\"2004\":\"467\",\"2005\":\"4086\",\"2006\":\"40874\",\"2007\":\"6487\",\"2008\":\"4984\",\"2009\":\"8749\",\"2010\":\"87598\",\"2011\":\"4874\"}]"}
All my schemas, model and structure of json response are the same.
Please someone help me
In the second case you have quotes before the array of element { "readexcelbyteResult":"[ , that makes the system understand it as string and not as an array of data. Also, all the elements seems to have an extra escape character before the quotes \"IFRS\":\"Volume\" should be: "IFRS":"Volume"
So, it should looks like:
{"readexcelbyteResult":[{"IFRS":"Volume","2001":"645645","2002":"875","2003":"8598","2004":"6986","2005":"98698","2006":"698698","2007":"6989698","2008":"57487","2009":"487487","2010":"4875","2011":"458"},{"IFRS":"ipsum","2001":"456456","2002":"6986","2003":"98698","2004":"6986","2005":"986","2006":"98698","2007":"698698","2008":"6986","2009":"98698","2010":"69860606","2011":"9860"},{"IFRS":"dolor ","2001":"366397","2002":"4364","2003":"98308","2004":"467","2005":"4086","2006":"40874","2007":"6487","2008":"4984","2009":"8749","2010":"87598","2011":"4874"}, {"IFRS":"amet","2001":"646456","2002":"875","2003":"8598","2004":"6986","2005":"98698","2006":"698698","2007":"6989698","2008":"57487","2009":"487487","2010":"4875","2011":"458"},{"IFRS":"consectetuer ","2001":"645645","2002":"6986","2003":"98698","2004":"6986","2005":"986","2006":"98698","2007":"698698","2008":"6986","2009":"98698","2010":"69860606","2011":"9860"},{"IFRS":"adipiscing ","2001":"536397","2002":"4364","2003":"98308","2004":"467","2005":"4086","2006":"40874","2007":"6487","2008":"4984","2009":"8749","2010":"87598","2011":"4874"},{"IFRS":"Maecenas ","2001":"456456","2002":"875","2003":"8598","2004":"6986","2005":"98698","2006":"698698","2007":"6989698","2008":"57487","2009":"487487","2010":"4875","2011":"458"},{"IFRS":"porttitor ","2001":"564564","2002":"6986","2003":"98698","2004":"6986","2005":"986","2006":"98698","2007":"698698","2008":"6986","2009":"98698","2010":"69860606","2011":"9860"},{"IFRS":"congue ","2001":"366397","2002":"4364","2003":"98308","2004":"467","2005":"4086","2006":"40874","2007":"6487","2008":"4984","2009":"8749","2010":"87598","2011":"4874"}]}
There are dozens of html/text Lorem ipsum generators around; However something I haven't found which I find strange with the prevalence of Markdown online is a Markdown Lorem Ipsum generator.
Does anyone know of one online somewhere or of any reason one wouldn't exist?
I recently came across this awesome markdown lorem ipsum generator called Lorem Markdownum.
It's configurable and includes random generation of all markdown elements using Markov chains and other cool stuff.
Here's a sample output:
Amoris Pindusque spreta Denique et positus quoniam
Inquit Tyriis cervos circuit Hyrie ocius sitientes
Renuente feruntur fontibus pares, ait tertia lacunabant animo, est. Limina
pulvere victima fores Aeacidae. Cum sua muneris spargit albis
glomerabat novercae puniceo. Vel quae
hac valuisse et artus intexuit ramosam Herculeos umbras. Ferarum niger.
Vestigia votorum turbatusque putes haeremusque matrem fateor
Iam natam sic fataliter uterque exiliis una
Proceres aethera
Amando littera solantia iam Paridis priorem dixisse
Illis altior bracchia lapides decus increpat ignota. Lucis suis eheu nec, sive
dicta villosa deos flexi me parvo tendere, talibus semper Polydegmona ait.
Refert versato vultus, percussit pavor, primum matrem care grande, iam adeundi
est arenti! Dracones hinnitus soleo sequenti, Arethusae me morte sanguine;
inscripsere summa: ego.
logicPim = imapOptical(19 - laserIconSpreadsheet, text_technology(
yobibyte_regular_hyperlink, icio_gbps_compiler),
swipeOdbcInterface.gnutella_copyright(backside_netmask,
abend_camelcase, mbrCycleTag) + smmFileMemory);
waveform_server(mini_degauss_paper(ccMegapixel + default_minisite_ieee,
script_system));
rtf_restore_crossplatform(barBlu, css);
Quod res fulmen in, hunc, atque vivum. Quid aequor captivo illum, clausit in
dubitas mixta. Est penates est celas, modo perque reticere
orbem timore neptis refero. Sperneret viridis iaculis avis Phrygiisque alto!
I did this little thing while learning emberjs. Hope it helps!
http://juanda.me/tests/ember-lipsum-md/
This http://www.lorem-ipsum-html.com/ it is simple and clean, This provides code snippets with html like this:
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aliquam tincidunt mauris eu risus.
Vestibulum auctor dapibus neque.