Page 1 of 2

Workable Mapping for a Collapsible Listview

Posted: Fri Jun 03, 2016 7:44 pm
by leonardo

I am trying to use Collapsible Listview to categorize my list of aticles into years. I want the year of the articles to be in the header and all of the articles of the year to come under it in a list.
I am not sure how to do the mapping so each year has a header and the list for each year go under the appropriate list. Here is what I currently have as mapping and result:

Image

Image


Workable Mapping for a Collapsible Listview

Posted: Fri Jun 03, 2016 8:40 pm
by Serhii Kulibaba

Hello Leonardo,

You have to have the data structure like: array of years, where each year has an array of articles.

Please use for that Storage variable (https://devcenter.appery.io/documenta...) with the Model structure above.

So you have to process service response with JS code and save the result to the Storage variable.
After thate you'll be able to use that Storage variable in the case you described.


Workable Mapping for a Collapsible Listview

Posted: Sat Jun 04, 2016 4:15 am
by leonardo

Thanks, but there is a strange thing happening with this. Somehow, I couldn't access Storage from Mapping. Page and Service are clickable and accessible, but not Storage. I've cleared the browsing data and tried Chrome and Firefox with the same result.


Workable Mapping for a Collapsible Listview

Posted: Sat Jun 04, 2016 2:28 pm
by Serhii Kulibaba

Did you create Storage variables before that? Image


Workable Mapping for a Collapsible Listview

Posted: Sat Jun 04, 2016 8:25 pm
by leonardo

Yes, I created the storage. I can't show the image now, but I created the model first and named it "years". Then I created a storage based on "years" model. The "years" storage has the parameters: "year" with a type Array to show the years. Two String parameters are added to show the "id" and "nns" that are differing values showing under each year.

Am I on the right track there and why is the storage mapping unclickable?


Workable Mapping for a Collapsible Listview

Posted: Tue Jun 07, 2016 6:09 pm
by leonardo

It seems that this particular app is corrupted. I can click and unclick or access the Storage on another app, but not this one. I had installed a bunch of sample app with it earlier and have since deleted them. I don't want to delete the whole app and start all over again. Is there a workaround for this, as I can't access the storage on the page?

By the way, is it not possible to use javascript to do the mapping once the storage variable is set and collect the info as noted above?


Workable Mapping for a Collapsible Listview

Posted: Wed Jun 08, 2016 8:36 am
by Serhii Kulibaba

What do you mean with "I can't access the storage on the page" ?
Please check if there are any errors in the browser console. You can learn here: https://devcenter.appery.io/documenta... how to open the console.


Workable Mapping for a Collapsible Listview

Posted: Thu Jun 16, 2016 7:12 pm
by leonardo

I got that part working now. It was a fluke with the app. It was corrupted and so the storage setting was not accessible.
Now that it is fixed, I am having problem going about what I intend to accomplish. I am not sure how to go about this. Here is my data:
Image

And here is the storage that I set up for it:
Image

Here is the UI I'm after:
Image

This is where I'm stuck: How to get array of distinct years with arrays of the articles under each year with the data that I have. codevar response = JSON.stringify(data);/code gave me all the data.


Workable Mapping for a Collapsible Listview

Posted: Fri Jun 17, 2016 4:56 pm
by Serhii Kulibaba

Please use a loop by these arrays with checking ids, if they are the same - add information from one array's item to another one


Workable Mapping for a Collapsible Listview

Posted: Fri Jun 17, 2016 11:08 pm
by leonardo

Not sure how to proceed. What I came up with gave a much worse implementation.

  1. What will be the structure of the array?
  2. Will there be 1 or 2 arrays?
  3. What will the mapping look like?
    Please, help with example.