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
Developer
Posts: 281
Registered: ‎05-31-2012
My Device: Playbook
My Carrier: o2
Accepted Solution

How to add a Item in my Grid grid-layout?

Hi, I have a page with a grid-layout which looks like this:

<div data-bb-type="screen" data-bb-effect="fade">
	<div id="MyGrid" data-bb-type="grid-layout" data-bb-context="true" data-bb-header-justify="left">
		
	</div>
</div>

 I want to add the following html to MyGrid:

<div data-bb-type="row">
	<div data-bb-type="item" data-bb-img="foo.png" data-bb-title="Hello">	
		World
	</div>
</div>

 I want to do it with jQuery so I wrote the following code:

<script type="text/javascript">
	document.addEventListener('webworksready', function(e) {
		bb.init({ondomready: function(element, id, params) {
			if (id == 'main') {
				
				// fill with data
				$("#MyGrid").append('<div data-bb-type="row"><div data-bb-type="item" data-bb-img="foo.png" data-bb-title="Hello">World</div></div>');
			}
		}});

		
		// Open our first screen
		bb.pushScreen('menu.htm', 'menu');
	}, false);
</script>

 But it is not woring and I dont know why. I just see the World as a string, but no new grid item.

Plase "+Like" my post if it was helpful.
Developer
Posts: 281
Registered: ‎05-31-2012
My Device: Playbook
My Carrier: o2

Re: How to add a Item in my Grid grid-layout?

I found the answer by myself, its not possible with the current release.

Plase "+Like" my post if it was helpful.