Or how can I prevent item that has "@false" not to be initially returned from the query?
Hi Panagiotis,
I've tested it and do not have this problem.
Here is details: http://prntscr.com/57tbih/direct
Please show us your public link and describe steps to reproduce this problem.
Regards.
The space appear for the item that value of Visible is false.
Do you have similar links as mine, shown in mine previous screenshot?
Do you have items that you set somehow dynamically the Visible to false
I take the value of visible as you proposed
code
var stringValue = String(value).trim().split("@");
return stringValue[1];
/code
And my values in DB is like this:
["Drink1@false","Drink2@true"]
["Food1@true","Food 2@false","Food3@true"]
I have a grid, to put first level of collabsibleset
and then another grid inside the content arear of collapsibleset, where I put the checkbox.
You have same configuration?
Thanks.
Hello!
You can hide checkboxes while mapping this way preelement.hide();/pre
EXACTLY it works!
Many thanks!
For the benefit of others, code used in the mapping of second level grid (checkboxes)
code
var stringValue = String(value).trim().split("@");
if (stringValue[1] == "false") {
element.hide();
}
/code
The construct I have is like this
"Settings mobilecontainer / mobilegrid_130/ mobilegridcell_131 /mobilecollapsblock_135 / mobilecollapsblockcontent_137 / mobilegrid_138 /mobilegridcell_139 / mobilecheckboxgroup_143/ mobilecheckbox_144"
and I am trying to iterate and collect all the checkboxes that are checked, with this code, but get an empty alert
code
var index;
var text;
var mobilecheckboxgroup = Apperyio("mobilecheckboxgroup_143").find(":checked");
var arr = [];
mobilecheckboxgroup.each(function(){
arr.push($(this).attr("value"));
});
localStorage.setItem("lclStg_par1", arr);
alert (localStorage.getItem("lclStg_par1"));
/code
Any idea?
Thanks!
Hi Panagiotis,
Your code seems to be ok.
Please try following to debug it(see in console):
pre
var index;
var text;
var mobilecheckboxgroup = Apperyio("mobilecheckboxgroup_143").find(":checked");
console.log("checked items = " + mobilecheckboxgroup.length);
var arr = [];
mobilecheckboxgroup.each(function(){
arr.push($(this).attr("value"));
Code: Select all
consooe.log("added checkbox with value: " + $(this).attr("value"));
});
console.log(arr);
localStorage.setItem("lclStg_par1", arr);
alert (localStorage.getItem("lclStg_par1"));
/pre
Regards.
Do I have to do something to see the console log?
I used alert and I get "checked items =0"
I does not seem to go in to the code of "mobilecheckboxgroup.each(function(){"
Hi Panagiotis,
pre
checked items =0
/pre
That means following code returns 0 items.
pre
Apperyio("mobilecheckboxgroup_143").find(":checked");
/pre
Two available reasons:
1 You mistaken with checkboxgroup component name.
2 You don't have any checked items in this component.
Regards.