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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

do not show all datatable fields in grid

rmórocz
1-Newbie

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

1 ACCEPTED SOLUTION

Accepted Solutions
AdamR
12-Amethyst
(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
12-Amethyst
(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-Newbie
(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
12-Amethyst
(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

Top Tags