Page 1 of 1

How to read all the label values in a mobilecollapsblock

Posted: Sun Jun 07, 2015 2:23 pm
by Enfiled Riders

I have a mobilecollapsblock component which has a label inside each mobilecollapscontent.

How can I read all the label text values?

Thanks,


How to read all the label values in a mobilecollapsblock

Posted: Mon Jun 08, 2015 5:47 am
by Serhii Kulibaba

Hello Enfiled,

Please use this JS code for collapsibleblock "mobilecollapsblock":

var labes = Apperyio("mobilecollapsblock").find('[data-role="appery_label"]').text();


How to read all the label values in a mobilecollapsblock

Posted: Mon Jun 08, 2015 6:07 am
by Enfiled Riders

This code just shows me the first item.
How do I iterate to show all the labels?


How to read all the label values in a mobilecollapsblock

Posted: Mon Jun 08, 2015 6:12 am
by Enfiled Riders

How to read all the label values in a mobilecollapsblock

Posted: Tue Jun 09, 2015 11:45 am
by Enfiled Riders

Hello the issue is still not solved!

How do i iterate between the collapsible list labels?

Thanks,


How to read all the label values in a mobilecollapsblock

Posted: Wed Jun 10, 2015 3:17 am
by Yurii Orishchuk

Hi Enfiled,

Here is how you can implement such logic:

pre

var collapsibles = jQuery('[name="mobilecollapsblock"]');

var allText = "";

for(var i = 0; i < collapsibles&#46;length; i++){
var currentText = jQuery(collapsibles)&#46;find('[name="labelName"]')&#46;text();

Code: Select all

  allText += currentText + " "; 

};

console&#46;log("allText = " + allText);

/pre

Regards.