Hello.
Is there a way to create several collapsibles inside a collapsibleset, based on a collection of data?
Hello.
Is there a way to create several collapsibles inside a collapsibleset, based on a collection of data?
Hi Quarenta.
Yes it is posible to generate two-level collapsible set based on service response data.
Please follow this solution:
pre
1 Put collapsible set on the page. And set items=1. http://prntscr.com/3izkvh/direct
2 Expand this one collapsible item. http://prntscr.com/3izmp0/direct
Code: Select all
2.1 Put HTML component inside.
2.2 Set "type" to "div".
2.3 Set dimentions with "auto" "auto" values. 3 Put collapsibleSet component inside "html" component from setp 2. Set items=1. http://prntscr.com/3iznut/direct
4 Open source tab. And navigate to "WER_RESOURCES"-resources-lib-base.
Code: Select all
4.1 Find "appery.js" file and duplicate it. http://prntscr.com/3izokk/direct
4.2 Open "appery.js" file and clear it.
4.3 Fill this file with content of following file(upoad it, open with text editor, copy all content and paste inside the "appery.js" file) https://www.dropbox.com/s/hg4y4k33j8esfgc/pathced_for_v2.0.appery.js 5 Navigate to data tab. And create data source for some list service and click "Edit mapping". Note your list service shoud consist of two level arrays.
Code: Select all
5.1 Open "Response" tab.
5.2 Link "$[]" to first level mobileCollapsibleBlock. http://prntscr.com/3iztbe/direct
5.3 Link "$[]-yourArrayInsideItem" to second level mobileCollapsibleBlock. http://prntscr.com/3izv5h/direct 6 Run your service datasource on "page show" event.
/pre
That's all..
You will recieve following result:
http://prntscr.com/3izvvh/direct
http://prntscr.com/3izw03/direct
Regards.
Thanks for your answer Yurii.
But i'm trying to form several collapsibles based on information that is based on a xml file placed on a folder resources, in the project. So, i need a way to link the number of items in the file with how many items the collapsible set should have.
Is it possible???
But i'm curious by the way. Why did you put a html element of type div inside the collapsblockcontent, before putting the 2nd level collapsible set? Would it make any difference to just put the 2nd level collapsible set inside the collapsblockcontent of the 1st level collapsible set?
Hi,
You can create a service that reads local XML file and add mapping to Collapsibleset.
Bonjour Katya. How have browse the service tutorials and found nothing concerned with our subject.
Could you exemplify your suggestion? I know how to read a xml file via jQuery, and know how to map a REST service response to a Collapsibleset, but what you said me to do i don't know.
Thanks
Hi,
Using HTML component as a container - is a workaround for current known bug, as well as appery.js file editing.
You can implement any datasource you need within Appery.io.
Please use "Generic service" for these goals. You should implement service manually, as you need.
Here is how to implement generic service in Appery.io: http://docs.appery.io/documentation/u...
Note, your own generic service should return two-level array like on the example above.