Could you show us screenshots where you set storage variable?
Hi Randy,
as i can see you have storage with name "votedReturn".
In your case you have:
storage "liveEventArray" with type - array of "liveEvent" model(where you have "votedReturn" parameter )
So your code will not work(cause of you use "votedReturn" as storage name):
pre
Apperyio.storage.votedReturn.update("$['thisVote']", true);
/pre
You need to access "Apperyio.storage.liveEventArray" storage instead.
Also it's not clear what you want to update in this storage. It's better to update with following way:
pre
var liveEventArray = Apperyio.storage.liveEventArray.get();
//here you can alter your array in way you need. Like:
liveEventArray[0].votedReturn = "true";
Apperyio.storage.liveEventArray.set(liveEventArray);
/pre
Regards.
Hi Yurii,
Thank you for your patience with me... I think we're almost there! With the above code, I am able to change the value of votedReturn at array index 0 [0]. How can I either
(1) get the index value and set it based on a variable
or -
(2) change votedReturn where songID = clickedSong?
liveEventArray[ where songID = clickedSong <<< ].votedReturn = "true";
We're so close! How can I get the index value from the Local Array for the clicked item? The working code below is JS on the button in the displayed list:
//This Vote
var row = jQuery(this).closest("tr");
var thisSong = row.find('[name="id"]');
var thisSongID = thisSong.text();
//console.log("clickedSong", thisSongID);
localStorage.setItem('id', thisSongID);
I need to get the Local Array index value for this item, but have not yet been able to do so.
Below code (currecord) returns the number of records, not the index of the clicked item:
Hi Randy,
That's what i see in your code, take a look on following screen shot:
http://prntscr.com/8arlyy/direct
Regards.
How can I get the index for a_id? The below code properly filters and returns the clicked object... I just need the index.
return item.a_id === searched;
Please help!
Randy,
You have you use JS like this:
prefor (var i = 0; i < currecord.length; i++){
if ( currecord.a_id === searched ){
alert("searched!");
}
}/pre