Skip to main content
1-Visitor
February 12, 2021
Solved

Can We expand image when image is stored in Grid(Clickable)

  • February 12, 2021
  • 2 replies
  • 1231 views

Hi,

i Stored image in Grid but it looks very small as it is inserted as a cell value..i used BaseType of the field is 'Image'.

can we expand image by clicking on it in Grid?

Thanks.

Best answer by c_lowy

Hi @VS_9760165,

 

Are you using a legacy Grid widget or a Grid Advanced ? What type of Renderer did you set for your column containing the Image in the "Configure Grid Columns" menu ?

 

There are a few possibilities I can think of :

  • You could set the basetype of the column to IMAGELINK instead of IMAGE and set the Renderer in the "Configure Grid Columns" menu of the Grid to IMAGELINK as well. This will allow you to display an image you have defined as Media entity previously and will give you more options as to how you want to display it :

 

  • You could use an HTML value in your column and set its value to something like <img src=/Thingworx/MediaEntities/<media_name> style=width:32;height:32;/> which will allow you to display a Media entity with a fixed size you define in pixels (in this example 32x32px). The height and width of the cell will adapt to the content.
  • Using HTML you can also display a "clickable image" that would take you to the URL of your choice and which size is also set in pixels : Implementing clickable icons on Advanced Grid Widget in ThingWorx
  • If using an IMAGE basetype there might be a possibility to set its size using custom CSS

I hope this helps !

2 replies

c_lowy16-PearlAnswer
16-Pearl
February 12, 2021

Hi @VS_9760165,

 

Are you using a legacy Grid widget or a Grid Advanced ? What type of Renderer did you set for your column containing the Image in the "Configure Grid Columns" menu ?

 

There are a few possibilities I can think of :

  • You could set the basetype of the column to IMAGELINK instead of IMAGE and set the Renderer in the "Configure Grid Columns" menu of the Grid to IMAGELINK as well. This will allow you to display an image you have defined as Media entity previously and will give you more options as to how you want to display it :

 

  • You could use an HTML value in your column and set its value to something like <img src=/Thingworx/MediaEntities/<media_name> style=width:32;height:32;/> which will allow you to display a Media entity with a fixed size you define in pixels (in this example 32x32px). The height and width of the cell will adapt to the content.
  • Using HTML you can also display a "clickable image" that would take you to the URL of your choice and which size is also set in pixels : Implementing clickable icons on Advanced Grid Widget in ThingWorx
  • If using an IMAGE basetype there might be a possibility to set its size using custom CSS

I hope this helps !

Community Manager
March 2, 2021

Hi @VS_9760165.

 

If you feel your question has been answered, please mark the previous response as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon