You need to sign in to do that
Don't have an account?
ravinder singh 95
Dynamically add/remove rows for a table in LWC and on pageload load only 2 records
@ Danish Hoda,
I have used code fron this link (https://developer.salesforce.com/forums/?id=9062I000000XvbXQAS) and it is working fine. But I want to display 2 records on datatable when pageload and then the Add row functionaity(which is working fine).
Can you please help me on this.
Thanks
I have used code fron this link (https://developer.salesforce.com/forums/?id=9062I000000XvbXQAS) and it is working fine. But I want to display 2 records on datatable when pageload and then the Add row functionaity(which is working fine).
Can you please help me on this.
Thanks
If you run this code, you will notice that value of i is not decreasing when removing the row.If anyhow we decrease the value of i on remove buton click than we are done.
All Answers
I have a scanerio, we can add upto 3 rows, and after e have added 3 rows button add "Add row" should be disabled.I have achieved this functionality.
Now when we remove a row, button again got enabled so that we can add one more row, I am not able to achieve this functionality.
Please find the code below.
Now when I remove the row, button gets enabled but can not able to add new row then.
Can you please help.
If you run this code, you will notice that value of i is not decreasing when removing the row.If anyhow we decrease the value of i on remove buton click than we are done.
Remove your js code methods of addRow and remove row with below:
This will work.
Do let me know if it helps you and close your query by marking it as solved.
Regards,
Santosh
I have posted one more question, can you please help me on that.
https://developer.salesforce.com/forums/ForumsMain?id=9062I000000QxZiQAK