3.2.0

Dynamic Margin in Combo

I would like to set the style of each line in the combo separately. I know that I can use something like:

obj.getContent("box/image").setStyle("margin-left", "25px");

to set the style for the whole object. Can this also be done for an individual line (or row)?
Brian Crandall
October 6,
The popup is an AW List -

http://www.activewidgets.com/aw.ui.list/

so you can start by accessing that to get to the individual items.
Anthony
October 7,
Have you tried?
obj.getItemTemplate(index).getContent("box/image").setStyle("margin-left", "25px");
where 'index' is the row in the combo listbox.
HTH
Carlos
October 7,
Perfect, Carlos, just what I needed. I knew there must be a way, I also knew I would never get there on my own.

Thank you!
Brian Crandall
October 7,
This works if there are images, but on combo objects without images it does not indent. Is this an issue with the defined styles or am I missing something?

And as long as I am here, I might as well ask... I cannot find the definition of the background for the combo popup item. I would like to reduce it in size, but cannot locate the code in aw.css.

Thank you.
Brian Crandall
October 12,
I think the text ("box/text" object) is preceded by the image, so you would also need to add a bigger indent to the Items without image, in the same way you do with image ("box/image"), but really never tried that.
HTH
Carlos
October 12,
hO! and for your other question, as Anthony said the combos' popup is a simple list object ( contained in a special floating frame/div), so you can get all list properties/methods from the above link.
Carlos
October 12,
upsss #2
If you are trying to redimension the whole drop-down combo's list container you must refer it by obj.getPopupTemplate() .
Search "getPopupTemplate()" in the forum and will get some samples.
Carlos
October 12,
Carlos,

Thank you. I did not even realize that I was using "box/image" instead of "box/text". Been looking at this code for too long! My dynamic indent is now working.

What I meant on the background of the combo's popup was the size of the image. I can see in aw.css that it is set as the background, but did not find the width (I realize the height will be set as defined by the font size used).


Brian Crandall
October 13,
for image size, please read:
http://www.activewidgets.com/javascript.forum.13578.1/button-image-repeat.html
http://www.activewidgets.com/grid.howto.cells/images.html
Carlos
October 13,

This topic is archived.

See also:


Back to support forum