Page 3 of 3

Save checkbox values to local storage

Posted: Wed Feb 05, 2020 5:34 pm
by Serhii Kulibaba

What code exactly do you use here and what result do you expect to see here?


Save checkbox values to local storage

Posted: Wed Feb 05, 2020 5:46 pm
by Ellen Schlechter

This is the code I use:

prevar arrayJS = value.C;
console.log("arrayJS = ", arrayJS);
var arrayJSON = JSON.stringify(arrayJS);
console.log("arrayJSON = ", arrayJSON);

return arrayJSON;/pre

My expectation: Since there are two items in the popup (see screenshot above), I would expect to see two of the long ids as listed on the left column and then both a and b as it is typed on the right side. Instead, it just grabs values from the first row, but I want values from each row that is there.


Save checkbox values to local storage

Posted: Thu Feb 06, 2020 7:35 pm
by Serhii Kulibaba

Sorry, but I didn't get your point. As I see on the screnshot it displays exactly the value, which you send to the label: Image

What values do you want to get on these labels? Could you please provide us with exact value


Save checkbox values to local storage

Posted: Fri Feb 07, 2020 4:52 am
by Ellen Schlechter

You are correct. Everything is fine in local storage. But now I am on to the next step and I am trying to break it apart. My result is in the console now instead of in storage. Image


Save checkbox values to local storage

Posted: Wed Feb 12, 2020 4:35 am
by Ellen Schlechter

Has anyone had a chance to take a look at this?


Save checkbox values to local storage

Posted: Fri Feb 14, 2020 9:54 am
by Serhii Kulibaba

Sorry, but it is not clear for me. What exactly do you need to do with these values? What is wrong with them? Please show us the exact screen you need to get


Save checkbox values to local storage

Posted: Sat Feb 15, 2020 12:22 am
by Ellen Schlechter

Okay, so with the current implementation as outlined above, the console.log shows the result of: pre arrayJS = 58d82049a428932046b19ca5 /pre

If you look at the screenshot of the what is on the device, there are two rows in the grid with two unique ids. In that case, I want both ids to show up in the console via mapping like such: pre arrayJS = 58d82049a428932046b19ca5, 58d8205aa428932046b19ca7/pre


Save checkbox values to local storage

Posted: Mon Feb 17, 2020 4:23 pm
by Serhii Kulibaba

Please make a loop through all array items here, and save a value of the exact property into the arrayJS. E.g.:prevar arrayJS = [];
for(var i = 0; i < myArray&#46;length;i++){
arrayJS&#46;push(myArray["A"]);
}/pre
it saves all properties "A" of tyhe array "myArray" into the variable "arrayJS"


Save checkbox values to local storage

Posted: Tue Feb 18, 2020 6:57 pm
by Ellen Schlechter

What should myArray be because it returns undefined right now?


Save checkbox values to local storage

Posted: Wed Feb 19, 2020 4:00 pm
by Serhii Kulibaba

This is the abstract example where each item of the array "myArray" has a property "A"