B4J Question [BANano] How to prepend content with BANano.LoadLayoutArray?

Solution
you can try wrapping each item in some kind of div and load the layout on that. This way you can insert such a wrap div before the others and then load the layout to it.

something like:
Code: Copy
<div id="mainlist">
    <div id="">
        ... add such a div before the others and load the new layout
    </div>
    <div id="">
        ... already loaded
    </div>
    <div id="">
        ... already loaded
    </div>
</div>

Alwaysbusy
you can try wrapping each item in some kind of div and load the layout on that. This way you can insert such a wrap div before the others and then load the layout to it.

something like:
Code: Copy
<div id="mainlist">
    <div id="">
        ... add such a div before the others and load the new layout
    </div>
    <div id="">
        ... already loaded
    </div>
    <div id="">
        ... already loaded
    </div>
</div>

Alwaysbusy
 
Upvote 1
Solution
Maybe .prepend() instead of .append() is what you are looking for? You would use that to add the item 'wrap' div at the beginning of the div 'mainlist'.
Tested with prepend, works perfectly.

Just need to figure out how to move items to the top of the list based on content change, more like how whatsapp works when a new message arrives and a chat moves up.

Thanks.
 
Upvote 0
Back
Top