cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to add a progress bar in a grid column?

S_Elsayed
6-Contributor

How to add a progress bar in a grid column?

Hello community.

 

I would like to have a progress bar as a column in a grid widget based on a percentage value from 0-100, how can I do that?

I am aware that progress bars could be done by a shape widget, so perhaps it could be possible to have a column as a shape that can take a value?

 

The goal is to have the grid look like this:

 

SE_10735050_0-1694330755144.png

 

Thank you in advance!

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @S_Elsayed 

 

Sure I will upload project entities so you can import them in your env.

 

Please follow the below steps :

 

1. Create a ParentMashup and place header label and collection widget

 

Velkumar_0-1694409900148.png

 

2. Create ChildMashup for collection widget with Label and Shape Widget

 

Note: DO NOT CALL ANY SERVICE OR CREATE ANY FUNCTION IN CHILD MASHUP.  (Which will affect the performance of the app )

 

Velkumar_3-1694410059066.png

 

3. Create Mashup Parameters in ChildMashup. Mashup Parameters will pass data from ParentMashup to ChildMashup

Velkumar_14-1694411075840.png

 

More about Mashup Parameters -  Configuring Mashup Parameters (ptc.com) 

 

4. Bind Mashup Parameters to Shape Widget and Label 

Velkumar_15-1694411126576.png

 

Velkumar_16-1694411139115.png

 

5. Enable Dynamic filling in Shape Widget and Set Dynamic filling maximum limit 

Velkumar_7-1694410333483.png

Velkumar_8-1694410344859.png

 

6. In parent Mashup, pass data to the collection widget from your service

 

Velkumar_9-1694410540228.png

 

7. Set Mashup property value as your childMashup which you created in step 2

Velkumar_10-1694410774345.png

8. Set UID Field which should be unique for each row. In my example I have set rowNumber as UIDField which is unique for each row

 

Velkumar_11-1694410815582.png

 

9. Configure Mashup Parameter JSON to pass data from service to childMashup

Velkumar_13-1694411031363.png

In Mashup Parameter JSON, the key should be dataFieldName from Service and the value should be Child Mashup Parameter name

 

10. Set Mashup height to 60px (each row height) and View Type to Table in the Collection Widget property

Velkumar_17-1694411264113.png

Velkumar_18-1694411276058.png

 

The result should look like this :

Velkumar_19-1694411306270.png

 

I have attached example entities for your reference.

 

/VR

View solution in original post

11 REPLIES 11

Hi @S_Elsayed 

 

You can use the collection widget as a Table to place a progress bar/shape. We cannot place a progress bar/shape in the Grid Widget.

 

/VR

S_Elsayed
6-Contributor
(To:Velkumar)

Thank you Velkumar.

 

Could you please elaborate on how I can use a collection widget for this? There are many configurations for the collection widget, so I am not quite sure how to use it even after checking out the docs.

Hi @S_Elsayed 

 

Check here for the collection widget property definitions - Collection Widget (ptc.com)

 

To make the collection widget look like a Table / Grid.

 

In Collection Property, set View as 'Table'

 

Velkumar_0-1694338718200.png

 

Set your mashup height as per requirement. 

 

Mashup will look like this in runtime :

 

Velkumar_1-1694338780064.png

 

/VR

 

 

S_Elsayed
6-Contributor
(To:Velkumar)

Thank you again @Velkumar for your help.

 

Would you mind sending me a link to this mashup, or walk me through the configuration and bindings you used please? Since I am facing some issues in making it look similar to this, even after setting view as "table". 

Hi @S_Elsayed 

 

Sure I will upload project entities so you can import them in your env.

 

Please follow the below steps :

 

1. Create a ParentMashup and place header label and collection widget

 

Velkumar_0-1694409900148.png

 

2. Create ChildMashup for collection widget with Label and Shape Widget

 

Note: DO NOT CALL ANY SERVICE OR CREATE ANY FUNCTION IN CHILD MASHUP.  (Which will affect the performance of the app )

 

Velkumar_3-1694410059066.png

 

3. Create Mashup Parameters in ChildMashup. Mashup Parameters will pass data from ParentMashup to ChildMashup

Velkumar_14-1694411075840.png

 

More about Mashup Parameters -  Configuring Mashup Parameters (ptc.com) 

 

4. Bind Mashup Parameters to Shape Widget and Label 

Velkumar_15-1694411126576.png

 

Velkumar_16-1694411139115.png

 

5. Enable Dynamic filling in Shape Widget and Set Dynamic filling maximum limit 

Velkumar_7-1694410333483.png

Velkumar_8-1694410344859.png

 

6. In parent Mashup, pass data to the collection widget from your service

 

Velkumar_9-1694410540228.png

 

7. Set Mashup property value as your childMashup which you created in step 2

Velkumar_10-1694410774345.png

8. Set UID Field which should be unique for each row. In my example I have set rowNumber as UIDField which is unique for each row

 

Velkumar_11-1694410815582.png

 

9. Configure Mashup Parameter JSON to pass data from service to childMashup

Velkumar_13-1694411031363.png

In Mashup Parameter JSON, the key should be dataFieldName from Service and the value should be Child Mashup Parameter name

 

10. Set Mashup height to 60px (each row height) and View Type to Table in the Collection Widget property

Velkumar_17-1694411264113.png

Velkumar_18-1694411276058.png

 

The result should look like this :

Velkumar_19-1694411306270.png

 

I have attached example entities for your reference.

 

/VR

S_Elsayed
6-Contributor
(To:Velkumar)

Hi @Velkumar 
Thank you so much for the detailed steps! I am able to create that table now. I greatly appreciate it.

S_Elsayed
6-Contributor
(To:Velkumar)

Hi @Velkumar 

Apologies, I have one last question.

 

Is there a way to style the collection cells, something like this?

S_Elsayed_1-1694512902718.png

 



I was testing the Style Properties in the parent mashup, but it made no difference:

S_Elsayed_2-1694512973731.png

S_Elsayed_3-1694512999253.png
Thank you for your time.

 

 

Hi @S_Elsayed 

 

Could you please explain a bit more? What exactly do you want to do?

 

/VR

S_Elsayed
6-Contributor
(To:Velkumar)

Hi @Velkumar 

As you can see in the image below, the collection widget table here has no styling, no cell colors, no borders, etc.

S_Elsayed_0-1694514768399.png

 

I want to make it look more like a table, preferably something similar to the image below:

S_Elsayed_2-1694515229634.png

 


I tried to edit the Style properties, but it made no difference:

S_Elsayed_1-1694515202084.png


Is there a way to style the collection widget to make it look more like the table above?

 

Thank you.

Hi @S_Elsayed 

 

Please follow the below steps :

 

1. Remove the background color for all containers in the child mashup

Velkumar_0-1694523681451.png

 

2. Add border to top-level container in child mashup

Velkumar_1-1694523722328.png

 

3. Set alternate style definition in collection widget style property

Velkumar_2-1694523761705.png

 

It should look like this :

Velkumar_3-1694523785418.png

 

/VR

 

 

 

 

 

S_Elsayed
6-Contributor
(To:Velkumar)

Great! Thank you so much for your time @Velkumar 

Top Tags