To format the value of the field with an html string, use the formatValue function (schould return a string):
1 | new inputEx.UneditableField({ |
2 | name: 'date', |
3 | value: new Date(), |
4 | parentEl: 'container1' |
5 | }); |
view plain | print | ? |
To render the value of the field with a DOM element (to add a behaviour), use the formatDom function (schould return a dom element):
1 | new inputEx.UneditableField({ |
2 | name: 'date', |
3 | value: 'http://neyric.com/images/diabolo.png', |
4 | visu: { |
5 | visuType: 'func', |
6 | func: function(value){ return inputEx.cn('img',{src:value},{border: '2px solid black'}); } |
7 | }, |
8 | parentEl: 'container2' |
9 | }); |
view plain | print | ? |
Display an image from the field value :
1 | inputEx({ |
2 | type: "uneditable", |
3 | name: 'pagerank', |
4 | value: 5, |
5 | label: "Pagerank", |
6 | visu: {visuType: 'func', func: function(value){ return inputEx.cn('img',{src: "http://www.page-rank-lookup.com/i/style1/pagerank"+value+".png"}) } }, |
7 | parentEl: 'container3' |
8 | }); |
view plain | print | ? |