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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

do not show all datatable fields in grid

rmórocz
1-Visitor

do not show all datatable fields in grid

Hi!

When i create a DataTable and show the content in a Grid there are some pre-defined fields like Location, Source etc.

In some cases i don't want to  show all the columns in a Grid only a set of them. Is there a way to acomplish this in Thingworx?


Thanks

ACCEPTED SOLUTION

Accepted Solutions
AdamR
14-Alexandrite
(To:rmórocz)

You can also use the RemoveField function for an Infotable after doing the query.  From our doc...

RemoveField(fieldName)

Removes this field from the Infotable data shape (fields collection).

So you could call...

infoTableName.RemoveField(location);

infoTableName.RemoveField(source);

...

View solution in original post

7 REPLIES 7
AdamR
14-Alexandrite
(To:rmórocz)

You can select the Configure Grid Columns option from the dropdown menu at the top left of the widget when it is selected in Composer design.  This allows you to select visibility, order, heading and styling of each grid column.

rmórocz
1-Visitor
(To:AdamR)

Thanks Adam, i will check, but to have only the required columns would be better than hide them in the grid.

You should write a service which returns only the desired fields.

This was my original idea, but the way to do it is not clear.

I can create an infotable and define another datashape and fill in de required data from the datatable into the infotable row by row, but it looks odd, to do it that way.

Do you have another idea how to do it?

You don't need to create a new infotable, you query the DataTable from the service and you can remove the undesired fields ( there's snippets to do it )

AdamR
14-Alexandrite
(To:rmórocz)

You can also use the RemoveField function for an Infotable after doing the query.  From our doc...

RemoveField(fieldName)

Removes this field from the Infotable data shape (fields collection).

So you could call...

infoTableName.RemoveField(location);

infoTableName.RemoveField(source);

...

Looks good, will check tomorrow.

Thanks

Announcements


Top Tags