Skip to main content
14-Alexandrite
September 17, 2020
Solved

How do I select multiple row in grid advance?

  • September 17, 2020
  • 1 reply
  • 4831 views

Hello,

            I'm using thingworx 9.0 version ,I add one boolean field in Datashape and Set isEditable property of the grid advance.but when i select checkbox is not selected please suggest how do i  I select multiple rows by using checkbox in grid advance? 

Thanks in advance

Best answer by emscur

Hello @RM12,


This will not work with Selected Rows output data of the service. You will need to write your own custom code using the EditedTable property of the grid to manipulate the data in a custom service using the code snippet provided.

 

Thanks,

Emmanuel

1 reply

5-Regular Member
September 17, 2020

Hello @RM12,

 

You can achieve this by following the steps below:

 

  1. Click on the top left corner arrow on Advanced Grid, and go to Configure Grid Columns
  2. Select the boolean field and check Editable under Cell Editing Options

In run time, user will select the desired rows in the grid by checking the boxes. You can then have a Submit button on the mashup for whenever customer is done selecting the rows to activate a service to analyze the data.

 

Keep in mind you will need to manipulate this data in a custom service using the Edited Table infotable property of Advanced Grid as parameter. This means you will need to parse all rows in the table to verify which ones have the boolean field equal to true and populate a temporary infotable with these rows if you want to return only the selected rows as output.

 

Regards,

Emmanuel

RM1214-AlexandriteAuthor
14-Alexandrite
September 18, 2020

Thanks for your reply, I tried with 2 steps

   1 ) I create service for grid ( I  store data into DB, also stores member ID parameter data) and bind that service to grid advance and click on Configure Grid Columns I select parameter which I want .In one parameter (Member ID) ,click on Column Renderer & State Formatting  and set  boolean renderer in checkbox format and check Editable under Cell Editing Options and check IsEditable Property after View  mashup It has already checking checkbox with default value is 1 .please refer 1st attachment.

2) 2nd steps, which I already discuss In datashape I add one definition  and select boolean field and check Editable under Cell Editing Options and Set isEditable property  I want to pass multiple  ID through grid advance by checking checkbox.Is This Method is suitable?? please refer 2nd attachment. 

 

I have many members and members ID  which is stored in the DB.I want to pass multiple  ID(Member ID) through grid advance by checking checkbox.I follow 1st step,but it has already checking checkbox.

How do I pass multiple ID through grid advance by checking multiple checkbox??

Can We add checkbox in grid advance with different way ??

Hope you understand the story..Please suggest.

 

5-Regular Member
September 22, 2020

Hi @RM12,

 

The second method is suitable. You will need to pass EditedTable property of the grid to the service and query yourInfotable to verify which rows have the Select column equal to true. The resulting tempInfotable will contain ONLY the selected rows based on Select column. Find helpful code snippet below:

 

 

// create query for Select column == true
var query = {
 "filters": {
 "fieldName": "Select",
 "type": "EQ",
 "value": true
 }
};

// apply query
// tempInfotable is the infoTable containing ONLY rows whole Select == true
var tempInfotable = Resources["InfoTableFunctions"].Query({
 t: yourInfotable,
 query: query 
});

 

 

Then, you can parse through tempInfotable to get Member ID for each row.

 

Thanks, 

Emmanuel