Skip to main content
1-Visitor
August 31, 2020
Solved

How to add checkbox in the grid column to pass multiple row data to the one service

  • August 31, 2020
  • 1 reply
  • 5237 views

Hi everyone,

1. I want to add a checkbox into the grid to select multiple rows from the grid to pass this data to the service which has one info table input parameter.

How can I do that?

 

2. Also, I want to add a link to the grid column, so that when I click on a particular row link it will open a popup or replace the window of another mashup using this row id.

 

I am using the Thingworx 9.0 version, Please suggest me.

 

Best answer by emscur

Hello @Suraj2692,

I understand the use case now. I would suggest using another mashup to edit/display the information about specific row. You can achieve this by using Navigation functions. You can create one mashup for viewing data and another one (with text boxes) for editing data. However, in this case, the edit/view button will not be in the grid, they will be outside of the grid and activated whenever you select a row in the grid.

 

In summary, you will need to follow these steps:

  1. Create two additional mashups: one for View and another one for Edit
  2. Add a mashup parameter to each of these new mashups (ID field)
  3. Bind the mashup parameter to a service that will retrieve the data specific for that ID
  4. Bind the output Returned Data to labels/text boxes for viewing editing purposes
  5. Add a Save button to the Edit mashup and bind it to a service that will update that row in the Database/Data table with the new values in the text boxes as parameters
  6. Back to the main mashup, bind the Selected Rows > ID output to the Navigation functions' ID mashup parameter (whenever you select a different row in the grid and click the View/Edit buttons, it will pull the information for that specific selected row)

 

Attached below is an example of the bindings that need to be done:

 

newNav.PNGHere is the view for creating a new Navigation function, selecting the Target Mashup, and window type:

 

newNav.PNG

 

Thanks,

Emmanuel

1 reply

5-Regular Member
September 2, 2020

Hello @Suraj2692,

This is very much possible in ThingWorx! 

1. In order to allow for multi-selection of rows on an Advanced Grid, you must change the RowSelection property of the grid to Multiple. In run time, you can select all the rows you wish by holding down the Ctrl key on your keyboard. Then, you can bind the SelectedRows infotable property of the grid as service input. 

 

2. You can add a property to the Thing Template with a Link value type. Once the grid is populated, you will see a hyperlink mapping to the location you have specified in each link corresponding to each row. This could be a web address (http/https) or a location in your ThingWorx repository.

I hope you find this information helpful in developing ThingWorx solutions!

Regards,

Emmanuel

Suraj26921-VisitorAuthor
1-Visitor
September 3, 2020
Thanks for your reply 1. Using the CTRL key it is very difficult for the end-user, that's why I want to give a checkbox to every row so that users will select data whatever they want. I did for multiple but unable to add checkbox in the grid, how can do that 2. I want to add one link to each row so that by clicking on this link popup will open with a selected row id, I don't want to use collection or repeater here because I have more number of rows data which is not possible to show on collection it is very slow to load all data, that's why I want to use the grid. Please suggest me
5-Regular Member
September 3, 2020

Hello @Suraj2692,

 

  • What kind of data are you binding to the grid widget? Is it data from a data table, or data from Things and property values (i.e. GetImplementingThingWithData...)? 
  • What is the use case? Are you trying to edit the data in the grid widget and then pass that edited data to the server? Or are you simply trying to select the rows? 

Regards,

Emmanuel