Brian King wrote:
> [Cross-posting : Setting follow-up to mozilla.dev.tech.xul]
> 
> I am working on a XULRunner based project, and one of the most prominent 
> UI features is a specific type of listbox.
> 
> The requirements of this listbox are:
> - a header that does not scroll with the items
> - rich XUL content inside (icons, description and link in one cell, 
> button in another)
> - subheading rows allowing to expand/collapse items (one level only, 
> have custom impl)
> - columns that resize based on window (or container) size
> 
> Largely because of the XUL content, trees are out.
> 
> We tried 4 approaches, and none have been ideal. Each have their 
> advantages, but I will focus on the things that don't work as we need 
> them to:
> 
> 1) XUL Grid
> - no concept of a header. Tried position: fixed/absolute, and various 
> other things, but header columns then don't align with content columns
> - columns size based on content, jiggle during row addition even when 
> size set with fixed pixel widths.
> 
> 2) XUL Listbox
> - all rows are the height of the tallest row
> - columns only size as desired with fixed pixel widths, otherwise 
> column(s) with wide content squeezes out the others.
> 
> 3) XUL Richlistbox
> - no concept of a header
> - columns only size as desired with fixed pixel widths, otherwise column 
> with wide content squeezes out the others.
> There is a patch in https://bugzilla.mozilla.org/show_bug.cgi?id=367843 
> that looks encouraging because it adds header and column support to 
> richlistbox, but it seems to just mimic listbox approach. It might fix 
> the issue of all rows being the same height, but probably not the column 
> sizing issues.
> 
> 4) HTML Table
> - certain annoying layout issues of using XUL mixed with HTML, such as 
> XUL content not stretching to fit space in TR and TD.
> - Table body does not scroll, no scrollbar appears. Only workaround 
> seems to be to set an explicit height on the tbody, but that would need 
> to be calculated in JS - a la 
> http://www.webtoolkit.info/scrollable-html-table.html - but this is less 
> than elegant, and even that doesn't work in all cases.
> 
> So I'm sending this in the hope that someone might know a workaround to 
> some of the issues mentioned in one of the approaches, or suggest an 
> alternative approach.
> 

You could get around the problem with the table scrolling by using a 
xul:browser with a document with a table. Make sure to check what 
happens to the context menu (or that might be weird) and set the 
browser's type attribute to "chrome" so you can access its content 
normally from your XUL window. As for stretching the elements, IIRC it 
works better if you wrap them in an html:div. But that's hearsay from 
something only vaguely related from ages ago. YMMV.

Hope that helps,
Gijs
_______________________________________________
dev-tech-layout mailing list
[EMAIL PROTECTED]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to