Show an image in column of a table (Servoy Extra Components)

Forum to discuss the new web client version of Servoy.

Show an image in column of a table (Servoy Extra Components)

Postby huber » Fri Feb 05, 2021 10:30 am

Looking at the documentation, I could not find an answer. How to display an image (existing in the Media Node of the Developer) in a column of the table from Servoy Extra Components?

Regards,
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 407
Joined: Mon May 14, 2012 11:31 pm

Re: Show an image in column of a table (Servoy Extra Compone

Postby pitc » Fri Feb 05, 2021 2:14 pm

Robert
The use of a data provider for the column and display as html might be useful:
Code: Select all
    vf_image_test = '<html><img src=\"media:///money.png\" width="24" height="24"></html>';


See the attached screen capture. Of course you can modify to get image from a database table and via a calculation result in the html string.
I am sure others will chime in with different ideas.
Tom
You do not have the required permissions to view the files attached to this post.
Tom
prospect-saas.com
pitc
 
Posts: 89
Joined: Thu Nov 14, 2019 2:22 pm
Location: Ottawa, Ontario, Canada

Re: Show an image in column of a table (Servoy Extra Compone

Postby huber » Fri Feb 05, 2021 5:57 pm

Hi Tom

Again, thank you, works as you describe :-)

Best regards,
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 407
Joined: Mon May 14, 2012 11:31 pm

Re: Show an image in column of a table (Servoy Extra Compone

Postby mboegem » Mon Feb 08, 2021 3:21 pm

Hi Robert,

performance-wise I can recommend using font-awesome icons.
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1574
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Show an image in column of a table (Servoy Extra Compone

Postby swingman » Tue Feb 09, 2021 10:22 am

Anything CSS-based... Just display a div with a class name the HTML data-type set in the column.
Style the class in your CSS. You can use Font-Awesome which will be very fast as Marc says, or your own images specified in the CSS.
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1379
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Show an image in column of a table (Servoy Extra Compone

Postby huber » Tue Feb 09, 2021 2:58 pm

Thanks both of you for the hints and the detailing. We use custom designed icons. These are professional made icons adapted for the corresponding menu. The font awesome library has not such specific icons.

Christian, if you say ... images specified in the CSS. To be able to get the image as a data provider, I have

... my images in the Media node and have scope variables defined like in following example

Code: Select all
/**
* @type {String}
*
* @properties={typeid:35,uuid:"50D032E0-66E0-497C-B6F2-420ED6B51A5B"}
*/
var btnAddBlue = '<html><img src=\"media:///btnAddBlue.png\" width="30" height="36" style="margin:0px 0px 4px 0px"></html>';


This way I can access them bey NG-Grids and servoy extra table. Are there easier ways to do that?

Best regards,
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 407
Joined: Mon May 14, 2012 11:31 pm

Re: Show an image in column of a table (Servoy Extra Compone

Postby mboegem » Wed Feb 10, 2021 5:21 pm

huber wrote:We use custom designed icons. These are professional made icons adapted for the corresponding menu.

Maybe you can get those converted to a webfont?

If you want media images via css, you'll find information here: viewtopic.php?f=69&t=21049
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1574
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Show an image in column of a table (Servoy Extra Compone

Postby huber » Wed Feb 10, 2021 7:46 pm

Marc

Image media via css work like a charm, much easier than what I tried. Thanks a lot for the hint. Also for the webfont. I have to read more about that.

Best regards,
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 407
Joined: Mon May 14, 2012 11:31 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: Google [Bot] and 2 guests