Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

storage models and array

first screen is the wrong one, see here

Image

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

storage models and array

any news here Evegene

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

storage models and array

Hello Michael,

Sorry not yet, working on it.

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

storage models and array

anything Evegene?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

storage models and array

Hello Michael,

Sorry for delay. If an array of IDs is kept in yours favprop_id, the code
preif (value.favprop_id != localStorage.getItem("favprop_id"))/pre
is not correct.
Please check in model and storage that favprop_id is an array of strings. Then in the code you may do this way:
prevar favprop_idArr = Apperyio.storage.favprop_id.get();
if (favprop_idArr.indexOf(value.favprop_id) = 0)/pre

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

storage models and array

No good Evegene,
I added the code above but the the result is not being filtered, all properties in array are still printed. No errors in console

Here are some screenshots of the model storage the 2 arrays Im using and the add js, hoping this will find my mistake.

cheers

Image

Image

Image

Image

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

storage models and array

Evegene,
I really need a solution to this, I cannot wait another 2 weeks, with 3 apps to update

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

storage models and array

Michael,

You shouldn't change the whole code but only if.
i.e. the code in the mapping should look like this
prevar favprop_idArr = Apperyio.storage.favprop_id.get();
if (favprop_idArr.indexOf(value.favprop_id) = 0) {
$(element).hide();
}/pre
But to be honest I have a doubt about value.favprop_id after your screenshots. Please detail, on what field you are sorting? If the name of the field (in the structure on the left) is not favprop_id, please replace favprop_id to the desired name in the code. According to the screenshots, this is property_id, i.e. the code will be
prevar favprop_idArr = Apperyio.storage.favprop_id.get();
if (favprop_idArr.indexOf(value.property_id) = 0) {
$(element).hide();
}/pre

Return to “Issues”