Page 1 of 1

dynamically creating divs

Posted: Thu Jan 30, 2014 10:36 pm
by Victor Fagerström

I've created a html div object and stuffed it with labels etc. I want to use a list service to dynamically create that html div object with data from database. When I map the loop-symbol $ to the html div and the data to labels inside the div this doesn't to the job. No div is shown at all.

how can i achieve dynamically creating the div I've created?

Outside of appery I would have maybe done a unordered list and append the div inside a list post to that unordered list. Is this a solution and in that case, how do I implement it in appery?

V


dynamically creating divs

Posted: Thu Jan 30, 2014 10:58 pm
by maxkatz

It would be the same approach if you were doing it outside of Appery.io. You woulc create the div element in JavaScript and insert it into the DOM.


dynamically creating divs

Posted: Thu Jan 30, 2014 11:24 pm
by Victor Fagerström

Is there a way to use the div I created in appery? I want the result to be the same as when I use the list component and get things dynamically from the database, only I want the data to be placed in different divs instead of list-items.


dynamically creating divs

Posted: Fri Jan 31, 2014 12:22 am
by Victor Fagerström

Solved it. not perfect though. Added a listitem to appery and set data-icon="false". Then simply placed the div in listitem and looped like normal list. Used css to make list background-color transparent and no borders.

The thing is that in the appery workfield, the icon is still there, so You have to build the div to complete before placing it inside the list, as it gets pushed together in builder. Looks the same when testing though.

Maybee a button to hide/show list-icon in builder would be something to consider?

V


dynamically creating divs

Posted: Mon Feb 03, 2014 4:48 pm
by maxkatz

Hide/show the icon in the list?


dynamically creating divs

Posted: Mon Feb 03, 2014 5:46 pm
by Victor Fagerström

yes


dynamically creating divs

Posted: Wed Feb 05, 2014 7:39 pm
by maxkatz

We'll add this to our todo list.


dynamically creating divs

Posted: Wed Apr 01, 2015 11:42 pm
by adam griffin

How did you solve this?