|
Posted by Jonathan N. Little on 11/04/07 12:32
Adrienne Boswell wrote:
> Gazing into my crystal ball I observed "Jonathan N. Little"
> <lws4art@centralva.net> writing in
> news:fab3$472d410a$40cba7c4$8201@NAXS.COM:
>
>> Bone Ur wrote:
>>> Well bust mah britches and call me cheeky, on Sun, 04 Nov 2007
>>> 02:53:32 GMT Jonathan N. Little scribed:
>>>
>>>> I think dorayme is right here, server-side would have no idea what
>>>> available size with respect to the browser. I think it would require
>>>> some nasty JavaScript to calculate the available space and
>>>> reposition the contents. And of course would also have to hook the
>>>> onresize to do the process all over again if the user resizes the
>>>> browser... yuck!
>>> Not necessarily. One could use string-length of (record/row),
>>> converting the max to an em number with a reasonable amount of
>>> leeway/slop, then float the tables/containers themselves. The number
>>> of containers would be to taste, -sensible, of course, and their
>>> max-width would need to be a suitable fraction of typical
>>> screenwidth. This might break with super- large font-sizes, but most
>>> things do, anyway.
>>>
>> But you cannot get the browser viewport via server-side. This is a
>> client-side job. Also you need to know the height, not the width
>> inorder to "wrap" to the next column as the OP wishes...more fun...
>>
>
> Getting the height is simple, for example, let's say you have a maximum
> of 30 items in your record set. I do most of my development in ASP, so
> here it is in ASP.
>
> set rs = createobject("ADODB.Recordset")
> rs.Open sql, oconn
>
> if not rs.EOF then
> rsarr = rs.getrows()
> end if
> rs.Close
> set rs = nothing 'destroy the recordset
> connection.close
> set connection = nothing 'destroy the connection to the db
>
>
> breakrow = ubound(rsarr,2)/2
>
> for i = 0 to breakrow
> %>
> <li><%=rsarr(0,i)%></li>
> <%
> next
> %>
> </ul>
> <ul>
> <% for i = breakrow+1 to ubound(rsarr,2)%>
> <li><%=rsarr(0,i)%></li>
> <%
> next
> %>
> </ul>
>
>
>
Not sure where in there you get the height of the available space in
order to break the recordset into columns....
And if the user resizes his browser window after the page renders?
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
[Back to original message]
|