• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Function to remove rows from table not working

Resolved: Function to remove rows from table not working

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

i have a question about my function remove(btn). I can’t quite figure it out why its not working. This function have a button when i click it it is supposed to add it to the remove table and increase the counter, meanwhile decrease the counter from the main table and remove the row from there. Here is my code:


Answer:

Your append is moving the row which means this will DELETE the row regardless of which table it is in: row.parentNode.removeChild(row);
I strongly recommend counting the actual rows
Also delegating (eventListener on the tbody) makes the code simpler and allows us to remove the inline event handlers.
Lastly an array to keep the data in and a map to render it


If you have better answer, please add a comment about this, thank you!

css html javascript
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How to make statement case insensitive when uploading a dta file with specified columns?

27/03/2023

Resolved: Sort dataframe columns value by close it to another column

27/03/2023

Resolved: PostgreSQL resample 1 minute OHLCV candle data into 5 minute OHLCV candle data

27/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.