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

do not show all datatable fields in grid

SOLVED
Highlighted
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
Highlighted

Re: do not show all datatable fields in grid

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
Highlighted

Re: do not show all datatable fields in grid

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.

Highlighted

Re: do not show all datatable fields in grid

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

Highlighted

Re: do not show all datatable fields in grid

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

Highlighted

Re: do not show all datatable fields in grid

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?

Highlighted

Re: do not show all datatable fields in grid

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 )

Highlighted

Re: do not show all datatable fields in grid

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

Highlighted

Re: do not show all datatable fields in grid

Looks good, will check tomorrow.

Thanks

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum!