Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
I would like to delete selected rows in the grid. But, I can't find how to pass selected rows parameter to a service.
Please advise to me if anyone already have this experience to solve this problem.
Thanks in advance.
Hi
The best option is probably to configure the service you're using to delete the rows to have an InfoTable input parameter with the same DataShape as the service that provides the data to the grid. In your service, loop through the input InfoTable and delete the matching rows in the source data.
If you're only doing a single selected row at a time, then you can use SelectedRow(s), <PropertyName> as input to your delete service. There's examples for this in the Introduction to ThingWorx course material.
Regards
Ian
Thank you very much lan.
According to your advice, I did it. For others, I leave here my service code.
Input : Infotable /*SelectedRows in the grid*/
Output : Nothing
===================================================================
var values = Things["TEST_INFO"].CreateValues();
for(var i = 0; i < SelectedRows.length; i++) {
values.UUID = SelectedRows.UUID
var params = { values: values /* INFOTABLE*/ };
Things["TEST_INFO"].DeleteDataTableEntry(params);
}
===================================================================