Editing and deleting: rewiring To-do...

I am going to make this week’s post short, as I had very little free time this week and also had an issue with my laptop. Hopefully, I will make a more comprehensive post next week
Things I've worked on/completed since my last post…
To-do project (local storage).
Note: I haven’t actually been working on local storage as such - I was still restructuring my code to make everything run from my data object (my initial structure did have a data object, but the DOM was being built from an array of DOM elements ,which, looking back on it, I am not sure why I approached it this way).
Issues I had…
My numbering system for matching individual tasks to edit/delete buttons was a bit ‘all over the place’ and I think I had reset some number counts in my previous code (particularly when changing between projects). When restructuring this time, I thought I should really have unique IDs for tasks and delete/edit IDs, which would correspond to each other. I guess that I saw the mistakes in my previous set-up through trial and error.
Things that went well...
For reasons I don’t quite remember now, I struggled to get the task IDs in my data object to correspond to the delete and edit IDs in my DOM code, but yesterday, I fired up the laptop and immediately saw how I could fix it by linking the taskID and edit/delete IDs directly. I cannot quite explain why I was so slow to see this, but I’m just grateful that it worked.
Things I've learnt/need to improve on...
I hope that I will be able to anticipate how to set up data objects more efficiently in subsequent projects.
Plan for the forthcoming week...
Now that my data object/code has been reworked to align with local storage (meaning, I can associate my data object with local storage in the right format), I will be going back to trying to implement local storage tomorrow. Another step closer…
Subscribe to my newsletter
Read articles from CodeCara directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
