Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
Posts: 13
Registered: ‎12-21-2011
My Device: Developer
My Carrier: Developer

Dynamic List

[ Edited ]

Hi everyone, I was checking the UIExample https://github.com/blackberry/WebWorks-Samples/tree/master/UIExamples On the section called tall-list there are some examples to generate a list.

 

As you can see there are elements inside the html, I just want to add more elements not preloaded in html. I checked jQuery .html() .append() and so on but it doesn't work properly.

 

Here is the tallList.html

 

<div x-ww-type="tall-list">
	<div x-ww-type="item" onclick="alert('example click');" x-ww-img="images/avatars/adamA.jpg" x-ww-title="Adam A." x-ww-time="10:24 PM May 22">My car just broke down and I have one million things to do!!</div>
        <div id="newContent"></div>
</div>

 

And this is my jQuery function that I call

 

function loadContent() {
	var element="";
	
	element += '<div x-ww-type="item" onclick="alert("Chech it out");" x-ww-img="images/avatars/adamA.jpg" x-ww-title="Adam A.">My car just broke down and I have one million things to do!!</div>';

	$('#newContent').html('');
	$(element).appendTo('#newContent');
}

 

but the content is not loaded. I execute the script in the header.

 

Retired
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: Dynamic List

Hi devoidmx,

 

Can you try appending content to the parent div (the one with the "x-ww-type='tall-list'") as opposed to a subchild?

 

Also you may want to checkout the BBUI framework as its quite similair but I believe is more actively being developed on.



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Contributor
Posts: 13
Registered: ‎12-21-2011
My Device: Developer
My Carrier: Developer

Re: Dynamic List

Hi jeff, I've tried to append the elements to the parent and it didn't work. I was checking the JS and there is a addEventListener with "DOMContentLoaded". I'm checking how the content is append via jquery to solve this

 

Thanks for the ref to BBUI framework, I'm gonna check it out, but for now I need BB5 support for my app and