Replace an object with another in an array using bootstrap modal

Replace an object with another in an array using bootstrap modal

I'm trying to update an object if it's type="external" with the 'edit' button. On clicking edit, I get a pop-up/modal, wherein I can update the details.

I need to fix 2 issues: 
* I can't see the old values in the update modal while trying to update the data in my actual application. 
* Also, on clicking update, it is refreshing the entire page content. 
I guess that's happening due to replaceWith() method.

Note: I'd tried using splice earlier, but it causes duplication of updated objects.  - 
  1. myData.splice(index, 1, upObj)