Hi Team,
Is there a way how can i create an note taking app?
or a documents, tutorial. but instead of using the database, it will use localstorage to store the text.
Thanks,
She
Hi Team,
Is there a way how can i create an note taking app?
or a documents, tutorial. but instead of using the database, it will use localstorage to store the text.
Thanks,
She
Hi Team,
.push is not working. this is the code:
code
// Parse the JSON stored in allEntriesP
var existingEntries = JSON.parse(localStorage.getItem("testObject"));
if(existingEntries == null) existingEntries = [];
var entryTitle = Appery('txttitle').val;
var entryText = Appery('txtarea').val;
var entry = {
"title": entryTitle,
"text": entryText
};
localStorage.setItem("entry", JSON.stringify(entry));
// Save allEntries back to local storage
existingEntries.push(entry);
localStorage.setItem("testObject", JSON.stringify(existingEntries));
/code
Hello,
Please use:
Appery('txttitle').val()
instead of:
Appery('txttitle').val
Hi Sergiy,
Thank for replying, i already tried that and still the .push is "Uncaught TypeError: undefined is not a function", what do you think is the problem? i cant see any problems to the code.
Thank you,
She
this is the jsfiddle:
http://jsfiddle.net/Bxn2t/1/
Hi She - Could you please explain how you have implemented this in Appery.io?
Hi Ilya,
First created a model and storage screenshot below:
and then i put text area, text component the names are the ff::
txttitle - Appery('txttitle').val();
txtarea - Appery('txtarea').val();
the last step is i put the ff. code to the button:code
// Parse the JSON stored in allEntriesP
var existingEntries = JSON.parse(localStorage.getItem("NotesStorage"));
if(existingEntries == null) existingEntries = [];
var entryTitle = Appery('txttitle').val();
var entryText = Appery('txtarea').val();
var entry = {
"title": entryTitle,
"text": entryText
};
localStorage.setItem("entry", JSON.stringify(entry));
// Save allEntries back to local storage
existingEntries.push(entry);
localStorage.setItem("NotesStorage", JSON.stringify(existingEntries));/code
Did you add input components with names "txttitle" and "txtarea"? Could you check entryText's and entryTitle's values?
Of course. I added that components name which is txttitle = TEXTINPUT and txtarea = TEXTAREA
Sergiy, any updates here?