Skip to main content

displaying yahoo table later

1 reply [Last post]
Joined: 2008-07-25

Hi All -
I have a situation where I want to generate a yahoo table full of data, but not display it initially. When the user clicks a button after initial page render, THEN the table should display.

This all works great, except that when I have a table within a div like this:


When I switch the listContent div to "display: block", then the yahoo table has a width of 2px...

If I use display: block initially, the table renders fine.

When I inspect with firebug, I see a div within my div like this:


Is there a way I can get this table to initialize with proper width, when the page loads it within a display:none div?


Message was edited by: tysonnorris

Message was edited by: tysonnorris

Message was edited by: tysonnorris

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2008-07-25

as a followup, I have found that similar behavior occurs when displaying a yahoo.datatable within a tabbed view. This does NOT occur when using dojo.table.

For example, using yahoo TabView directly, creating a tabbed view via markup.
In the below trivial example, you can change "yahoo.dataTable" to "dojo.table" , and the table will work properly within tabs. Unfortunately, I cannot get the yahoo version to work.

<%@ taglib prefix="a" uri="http://jmaki/v1.0/jsp" %>

Build from Markup

Tab One Content

Tab Two Content

Tab Three Content

value="{columns : [
{ label : 'Title', id : 'title'},
{ label :'Author', id : 'author'},
{ label : 'ISBN', id : 'isbn'},
{ label : 'Description', id : 'description'}
rows : [
{ title : 'Book Title 1', author : 'Author 1', isbn: '4412', description : 'A Some long description'},
{ id : 'bar', title : 'Book Title 2', author : 'Author 2', isbn : '4412', description : 'A Some long description'}
}" />