Sign In Register

How can we help you today?

Start a new topic
Answered

Display JSON in dynamic form

Hi, I try to display a JSON object in a pretty way in dynamic form.

I can't make it work.


Left panel :

var j = {"_id":"12345","name":"Bob"};
var disp1 = JSON.stringify(j, null, 2);
var disp2 = JSON.stringify(j, null, "\t");
var disp3 = JSON.stringify(j, null, "<br />);


When I try to display {{disp1}}, {{disp2}} or {{disp3}} in the right panel, I never see the JSON displayed pretty, always on one line.

I would like to see in my <gs-col> :

{
  "_id":"12345",
  "name":"Bob"
}

 

Thanks for your help...


 


Best Answer

I finally succedeed putting the {{disp1}} tag between <pre></pre> html tags.


Anyway if the {{disp1}} tag contains html (bold for example), it's not rendered, and it would be good to know how to do that.

For example I want to display a value in different color based on its range...




1 person has this question

Looking into this Eric,


Thanks,


Oisin

Answer

I finally succedeed putting the {{disp1}} tag between <pre></pre> html tags.


Anyway if the {{disp1}} tag contains html (bold for example), it's not rendered, and it would be good to know how to do that.

For example I want to display a value in different color based on its range...



Login to post a comment