Victor Fagerström
Posts: 0
Joined: Sun Dec 01, 2013 1:03 pm

dynamically creating divs

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

dynamically creating divs

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.

Victor Fagerström
Posts: 0
Joined: Sun Dec 01, 2013 1:03 pm

dynamically creating divs

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.

Victor Fagerström
Posts: 0
Joined: Sun Dec 01, 2013 1:03 pm

dynamically creating divs

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

dynamically creating divs

Hide/show the icon in the list?

Victor Fagerström
Posts: 0
Joined: Sun Dec 01, 2013 1:03 pm

dynamically creating divs

yes

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

dynamically creating divs

We'll add this to our todo list.

adam griffin
Posts: 0
Joined: Tue May 21, 2013 8:44 pm

dynamically creating divs

How did you solve this?

Return to “Issues”