Just one more question and I will always be grateful!
Suppose I require the data from bookId = 1 and want to display the attribute data in a Modal component (we can imagine the bootstrap), I would also like to change any value of any field, imagine the title of the book and save next.
In the code below, I'm just giving you an idea! Can you help me organize this code?
functionopenModal(){$("#form").modal({show:true});}functionobjectForm(){constid=document.getElementById('id');consttitle=document.getElementById('title');constauthor=document.getElementById('author');id.value=Store.BOOK.id;title.value=Store.BOOK.title;author.value=Store.BOOK.author;}// use to save start// function called by the save buttonfunctionsaveBook(){formObject();}functionformObject(){constid=document.getElementById('id');consttitle=document.getElementById('title');constauthor=document.getElementById('author');Store.BOOK.id=id.value;Store.BOOK.title=title.value;Store.BOOK.author=author.value;}// // use to save end// GET BY IDasyncfunctiongetBookById(bookId){constbook=awaitFetch.get('/books/'+bookId);Store.BOOK=book;//return book;objectForm();openModal();}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
thanks for the return, it was of great help!
Just one more question and I will always be grateful!
Suppose I require the data from bookId = 1 and want to display the attribute data in a Modal component (we can imagine the bootstrap), I would also like to change any value of any field, imagine the title of the book and save next.
In the code below, I'm just giving you an idea! Can you help me organize this code?