Skip to content
This repository

Dynamically adjusting header to left doesnot work in BBUI #711

Closed
raakhtar opened this Issue February 19, 2013 · 8 comments

2 participants

Tim Neil

dynamic Text justification in image list does not work and always shows the content center aligned.

Code:
var categoryList = document.createElement('div');
categoryList.setAttribute('data-bb-type','image-list');

categoryList.setAttribute('data-bb-header-justify','left');

categoryList.setAttribute('id', 'categoryLst');

var header = document.createElement('div');
header.setAttribute('id', 'head');
header.setAttribute('data-bb-type','header');
header.innerHTML = 'Categories';
categoryList.appendChild(header);

Tim Neil
Owner

Where are you running this code? before or after the DOM is loaded?

the code is running after dom is loaded. As The List appears OK with the exception of title being center aligned instead of left-aligned

Tim Neil
Owner

In your code example, I don't see where you are calling bb.imageList.style()

Are you able to post the full code you are using?

bb.imageList.apply([categoryList]);
categoryList= bb.imageList.style(categoryList);
categoryContainer = document.createElement('div');
categoryContainer.appendChild(categoryList);

I just added categoryList = bb.imageList.style(categoryList); gives error under debug mode TypeError: 'undefined' is not a function (evaluating 'bb.imageList.style(avatarContent)') and the list will not show up. This is all being done before loading of DOM.

Tim Neil
Owner

You don't want to do an apply and a style, only style. The apply function was never intended to be public.

if bb.imageList.apply([categoryList]); is not used the list does note show. Moreover, I have also tried the style only option as well with no results. I am usin 0.9.6 beta release of BBUI

Tim Neil
Owner

Ah ok.. so I was mistaken in thinking that the style function had been added to the image list as recorded in issue #445

There currently isn't a good way to create an image list on the fly and then add it into the DOM. You can however have an empty image list and then refresh its items as shown in the following sample.

https://github.com/blackberry/bbUI.js/blob/master/samples/js/dataOnTheFly.js#L26

Tim Neil tneil closed this March 10, 2013
Tim Neil
Owner
tneil commented March 10, 2013

This should be made available with issue #445. I'm going to close this issue as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.