We need to know how to reference the collapsible items in each mapped collapsible area. Ive read something about $(".selector").collapsible("option") but not sure how to use it. Am I on the right track?
We need to know how to reference the collapsible items in each mapped collapsible area. Ive read something about $(".selector").collapsible("option") but not sure how to use it. Am I on the right track?
This is a related question in that I have this code to display the messages using different colours for read or unread items. However it sets all of the elements based on the last result. How do I refer to each element within collapsible
Code:
if (value === false) {
$("[name=lblMsgRead]").css("background-color","green");
} else {
$("[name=lblMsgRead]").css("background-color","red");
}
Screenshot:
I'm also having the same issue and have tried a few ways to get around this. None of them have worked.
1st way: Tried to save label text to a local variable from Events menu. This does not week. (Bug?)
2nd way: I'm trying to use the localStorage.setItems function but I can't get the value from the list.
I've tried a lot of variations and none have worked:
1) alert(Appery("listUserId").text());
--- this gets only the first value in the list
2) alert( Appery('listUserId', this).text() );
---- this is null or undefined.
3) jQuery('[name="listUserId"]').text()
---- this returns the entire list of IDs
Hi Aeneas,
Use the following code to set a background for all lblMsgRead child elements: preApperyio("lblMsgRead").find("*").css("background-color","red");/pre
Hi Rox,
Run the following code on listitem Click event to save a listUserId value:prelocalStorage.setItem("listUserId", $(this).find("[name=listUserId]").text());/pre
Thanks for your response.
I have a label and button inside a collapsible (which is inside another collapsible)and the onclick event does this command
alert($(this).find("[name=lblMatchid]").text());
However I'm getting a blank alert even though there's a value showing in lblMatchid at runtime.
Any ideas?
Thanks Katya but I need to set the style of each element depending on the value in the json data set that populates the collapsibles. So above false should be green and true red for example.
Hello Aeneas,
Please provide us with more details. By clicking on what element do you call this code? If it is button, then most likely, you should use this code:
codealert($(this).parent().find("[name=lblMatchid]").text());/code
Hi Evgene, that work perfectly and is exactly what I was after. Thanks for your help. I am now just awaiting a response from my question to Katya above.
Thanks!
Aeneas,
Use this code:
pre
if (value == false) {
Apperyio("startScreen").find($('div[dsid="mobilelabel_x"]')).css("background-color","green");
} else {
Apperyio("startScreen").find($('div[dsid="mobilelabel_x"]')).css("background-color","red");
} /pre
where startScreen - your page name or Collapsblock component name;
mobilelabel_x - your label component name.