Search Support
-
Martina JApril 3, 2019 at 5:30 am #5448
Hi Team,
I want to delete the selected row of the table using the button which is placed outside of the table.
The table is having multiple selection.
Please help me to get the selected row indexes of the table and delete the selected rows in “Button” on click
Regards
Martina
SPARK SupportApril 3, 2019 at 6:09 am #5450Hi Martina,
The getSelectedIndicies() method will return the selected rows.
http://support.salientprocess.com/docs/enterprise/Table.html#getSelectedIndices
Regards,
Stephen P.
Martina JApril 3, 2019 at 7:01 am #5451Hi Stephen
Thnak you. getSelectedIndices() returns the expected selected rows index in “Delete” button click.
But the below script which i used to delete the selected indexes is not working.
${Table1}.removeRecord(${Table1}.getSelectedIndices());
return false;will you please help whether the script is correct.
Regards
Martina
SPARK SupportApril 3, 2019 at 7:14 am #5452Hi Martina,
The removeRecord() method takes only one index at a time.
http://support.salientprocess.com/docs/enterprise/Table.html#removeRecord
You would need to iterate through the indexes returned from getSelectedIndicies() and remove one record at a time. It might be best to sort the indices returned and iterate through the list in descending order.
Regards,
Stephen P.
-
This reply was modified 3 years, 11 months ago by
SPARK Support.
Martina JApril 3, 2019 at 7:27 am #5453Hi Stephen,
removeRecord() is not working even for single record. Below script is used.
var selIndex = ${Table1}.getSelectedIndices();
${Table1}.removeRecord(selIndex);
return false;Instead of “selIndex” value , if i manually give the index number its deleting the row.
${Table1}.removeRecord(1);
Regards
Martina
SPARK SupportApril 3, 2019 at 10:34 am #5455Hi Martina,
The getSelectedIndicies() method returns an Array. You will need to develop logic to iterate through the Array. (i.e. selIndex[i] with for loop)
Please refer to the documentation.
http://support.salientprocess.com/docs/enterprise/Table.html#getSelectedIndices
Regards,
Stephen P.
-
This reply was modified 3 years, 11 months ago by
-
|
You must be logged in to reply to this topic.