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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Delete the Selected Row from the Grid in the Mashup

SP_9715784
12-Amethyst

Delete the Selected Row from the Grid in the Mashup

I have Created a MASHUP which has an GRID Widget which contains the data as shown in below figure:

 

SP_9715784_0-1611403024979.png

 

How Can I Delete the GRID Row on the Button "Delete" is pressed.

 

Thanks !!

ACCEPTED SOLUTION

Accepted Solutions

Hi, 

 

Got the Simple Solution,

 

1. Make Sure the Thing BaseTemplate is DataTable
2. Such that we can find lot of Services DeleteDataTableEntries, DeleteDataTableEntry and DeleteDataTableEntriesByKey.
3. For me the Row in the Grid got deleted for all the three services.
4. Create a Checkbox Column in the GRID and make it "Editable" and put the default value as False.

 

The Grid's Edited Table is the INPUT for the following Service

 

for (var i= 0;i<EditedTable.length;i++)
         {
	     var row = EditedTable.rows[i];
             if(row.CheckBox ===true)
                {
		    var values = me.CreateValues();
                    values.Column1 =  row.Column1;
                    values.Column2 =  row.Column2;
                    values.Column3 =  row.Column3;
                    values.Column4 =  row.Column4;
                    var params1={
                            values:values
                                  };
                    Things["DataTable_Name"].DeleteDataTableEntry(params1);
    		}
         }

 

View solution in original post

5 REPLIES 5
mgoel
17-Peridot
(To:SP_9715784)

Hi @SP_9715784 

 

Thank you for opening this thread on community. Are you using infotable to populate data on grid?

 

Check this thread if it helps:

https://community.ptc.com/t5/ThingWorx-Developers/selected-row-remove-on-infotable/td-p/664766?posno=9&q=delete%20selected%20row&source=search

 

regards,

Mohit

mgoel
17-Peridot
(To:SP_9715784)

Hi, 

 

Got the Simple Solution,

 

1. Make Sure the Thing BaseTemplate is DataTable
2. Such that we can find lot of Services DeleteDataTableEntries, DeleteDataTableEntry and DeleteDataTableEntriesByKey.
3. For me the Row in the Grid got deleted for all the three services.
4. Create a Checkbox Column in the GRID and make it "Editable" and put the default value as False.

 

The Grid's Edited Table is the INPUT for the following Service

 

for (var i= 0;i<EditedTable.length;i++)
         {
	     var row = EditedTable.rows[i];
             if(row.CheckBox ===true)
                {
		    var values = me.CreateValues();
                    values.Column1 =  row.Column1;
                    values.Column2 =  row.Column2;
                    values.Column3 =  row.Column3;
                    values.Column4 =  row.Column4;
                    var params1={
                            values:values
                                  };
                    Things["DataTable_Name"].DeleteDataTableEntry(params1);
    		}
         }

 

slangley
23-Emerald II
(To:SP_9715784)

Hi @SP_9715784.

 

Glad you found a solution!

 

For the benefit of others in the community, please mark your last post as the Accepted Solution.

 

Regards.

 

--Sharon

Hi @slangley 

 

I have already accepted the solution...

 

 

Thanks & Regards, 

Shashi Preetham

Announcements


Top Tags