Page 2 of 3

Sub menu of check boxes

Posted: Tue Nov 18, 2014 2:59 pm
by Takis

Or how can I prevent item that has "@false" not to be initially returned from the query?

Image


Sub menu of check boxes

Posted: Wed Nov 19, 2014 12:31 am
by Yurii Orishchuk

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.


Sub menu of check boxes

Posted: Wed Nov 19, 2014 8:10 am
by Takis

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"]


Sub menu of check boxes

Posted: Wed Nov 19, 2014 9:42 am
by Takis

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.


Sub menu of check boxes

Posted: Wed Nov 19, 2014 4:26 pm
by Maryna Brodina

Hello!

You can hide checkboxes while mapping this way preelement.hide();/pre


Sub menu of check boxes

Posted: Wed Nov 19, 2014 7:21 pm
by Takis

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


Sub menu of check boxes

Posted: Wed Nov 19, 2014 8:28 pm
by Takis

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!


Sub menu of check boxes

Posted: Thu Nov 20, 2014 1:23 am
by Yurii Orishchuk

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.


Sub menu of check boxes

Posted: Thu Nov 20, 2014 8:32 am
by Takis

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(){"


Sub menu of check boxes

Posted: Thu Nov 20, 2014 11:26 pm
by Yurii Orishchuk

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.