hi,
im trying to set a local storage to the contents of a html component i have. ive tried
localstorage.setitem('title2',apperyio('html_uk2').html());
with title2 my storage variable and html_uk my html component
but cant get it to work
hi,
im trying to set a local storage to the contents of a html component i have. ive tried
localstorage.setitem('title2',apperyio('html_uk2').html());
with title2 my storage variable and html_uk my html component
but cant get it to work
Hello David,
Could you please try
preApperyio.storage.storageVariable.update("$['title2']", Apperyio('html_uk2').html());/pre
You can read more about storage API here: http://devcenter.appery.io/documentat...
HI Evgene,
I tried it and still doesnt work, ive checked and all code after is stopped so i know its this line that the issue
Hello!
Do you create storage variable 'title2' at Model & Storage tab? Could you post screenshot?
Hi David,
If what you posted in your main question is the actual command you used
code
localstorage.setitem('title2',apperyio('html_uk2').html());
/code
then probably it's because of the "apperyio" or "setItem" method because JS is case-sensitive.
So you can try something like this
Split that code a bit more in the sense that
Write the contents of the HTML component to the console using console.log
If it has contents then try setting the LSV to those contents using
code
var html_component_contents = apperyio('html_uk2').html(); // Check if this is supposed to be Apperyio('html_uk2').html() or Appery('html_uk2').html() - case sensitive
console.log(html_component_contents); // check if contents are shown
localstorage.setItem('title2',html_component_contents); // setItem - case-sensitive
/code
Another thing that you can check is that is it some special character in your html content that is causing the LSV to not store the contents. Try some encoding to check that part too. If it is the special character, then you can encode it while saving, and decode it easily after retrieving
HI M&M,
thanks for your help but i think now the issue is around the contents of the html component as ive tried events set local storage and have the same issue.
The html component is set from a rss feed service, the strange thing is when you set the local storage from pressing a label component inside the grid it works (the grid is linked to the rss array but ive set it to hide elements to only show the second article from the feed) , when you action it from outside it doesnt show anything.
hope that makes sense
managed to get it working now, thank you M&M