Page 3 of 3

storage models and array

Posted: Thu Oct 23, 2014 1:39 pm
by Michael4771079

first screen is the wrong one, see here

Image


storage models and array

Posted: Fri Oct 24, 2014 1:43 pm
by Michael4771079

any news here Evegene


storage models and array

Posted: Fri Oct 24, 2014 1:51 pm
by Evgene Karachevtsev

Hello Michael,

Sorry not yet, working on it.


storage models and array

Posted: Mon Oct 27, 2014 3:45 pm
by Michael4771079

anything Evegene?


storage models and array

Posted: Mon Oct 27, 2014 4:28 pm
by Evgene Karachevtsev

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


storage models and array

Posted: Mon Oct 27, 2014 5:03 pm
by Michael4771079

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


storage models and array

Posted: Mon Oct 27, 2014 9:09 pm
by Michael4771079

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


storage models and array

Posted: Mon Oct 27, 2014 9:30 pm
by Evgene Karachevtsev

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