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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Dynamically creating columns - Grid Advanced rendering issue

mvajla
13-Aquamarine

Dynamically creating columns - Grid Advanced rendering issue

Hi guys, 

 

I have an issue with GridAdvanced widget.

 

I have a service with standard data shape defined and I am also creating new columns based on input coming from JSON (means: creating column names based on input).

 

When I bind a data from that service to the GridAdvanced Widget, it happen sometimes at runtime, that rendering of columns is not as I want, e.g. for hyperlink I will get only URL instead of clickable href and instead of checkbox for boolean I will get only a text.

 

But it happen only in some cases, when I am creating new columns at runtime and get the error in console: 

mvajla_0-1615381647085.png

What can I do to avoid this behavior? 

 

(Using standart od Dynamics grid does not help, because when I select "Show all columns" it lost that renders (checbox/hyperlink))

 

 

ACCEPTED SOLUTION

Accepted Solutions
mvajla
13-Aquamarine
(To:mvajla)

I had to solve it in different way.
Instead of creating basic DataShape, I have created DataShape with all potential fields and Iam dynamically removing them throught service. But this didn't solve the issue with AdvancedGrid, so I had to use DynamicColumns Grid with Show Dynamic column option.

 

Now it is rendering fine, but it is not so dynamicall as  I wanted - but Working

View solution in original post

5 REPLIES 5
slangley
23-Emerald II
(To:mvajla)

Hi @mvajla.

 

Is it possible that the data coming in sometimes does not match the data shape?  Have you checked the logs in \ThingworxStorage\logs for errors (Script log and Error log)? You many need to compare the data between successful processes vs. those that are unsuccessful to track down the cause.

 

What version of ThingWorx are you running?  Are you storing the JSON data in an infotable?

 

Regards.

 

--Sharon

mvajla
13-Aquamarine
(To:slangley)

Hi @slangley , 

 

I have created basic datashape for the service which iterate JSON coming from Windchill services to the infotable. 
The output of this service doesn't match that dataShape, but this should not be the issue.

 

In mashup I have a textbox widget, dropdown list, button and Grid Advanced.

The case is, when user put the input to the textbox, it will fetch data to the dropdown list. So user can select some entries from the list and base on this selection, the datashape, or output from the service is changing.

First selection and execution of the service is working fine - in advanced grid every row is fully rendered. 
The issue comes when I select another option and output is changed - rendering is off, but putting it back to the previous selection, everything is ok again. (every time selected rows are changing, I am executing that service again). Only renfering is the issue, all data are displayed.

 

There is also no error in logs. 
I am using ThingWorx 8.4.2-b2151 and Grid Advanced 4.2.1.

 

I was also trying to use DynamicColumnsGrid, but after selecting an option "Show Dynamic Column", it didn't show the dynamically added columns at runtime. Only when I select "Show all columns" it will show all, but also without rendering.

 

Marek

mvajla
13-Aquamarine
(To:mvajla)

I had to solve it in different way.
Instead of creating basic DataShape, I have created DataShape with all potential fields and Iam dynamically removing them throught service. But this didn't solve the issue with AdvancedGrid, so I had to use DynamicColumns Grid with Show Dynamic column option.

 

Now it is rendering fine, but it is not so dynamicall as  I wanted - but Working

slangley
23-Emerald II
(To:mvajla)

Hi @mvajla.

 

Glad you found a workaround.  Another option to consider that may work better:

 

Instead of a single mashup, create a separate mashup for each data shape possible coming from Windchill.  In each mashup, you will have the Advanced Grid widget with one of the possible data shapes being returned from Windchill.  In each use case, you can configure the rendering as needed.  On the parent mashup, where the drop-down is being selected, include a contained mashup to load the appropriate one based on the selections.

 

Regards.

 

--Sharon

slangley
23-Emerald II
(To:slangley)

Hi @mvajla.

 

If you are satisfied with the solution you found, please mark your response as the Accepted Solution for the benefit of others with the same issue.

 

Regards.

 

--Sharon

Announcements


Top Tags