This topic is locked

List Page Divider

3/9/2005 12:34:19 PM
ASPRunnerPro General questions
A
aspbeginner author

Is there any way to insert some kind of divider between different Items in a filed on the list page. Example One field contains 4 options from a drop dpwn and the list page is sorted by that field. Is there a way to insert a divider of some kind between the the items so that all items with the same value are groped together and separated from the others?

Sergey Kornilov admin 3/10/2005

Hi,
here it is:

Open the ..._list.asp in any editor and modify looprs function (see my changes in bold). Do not forget to replace YearOfMake with real field name.

if isObject(rs) then

  ' Pagination: UNTIL iNumberOfRows>=maxrecs

 

  nyear = rs("YearOfMake")

  DO  UNTIL rs.eof OR iNumberOfRows>=nPageSize

  if nyear <> rs("YearOfMake") then

    response.write "<tr height=4 bgcolor=#0000ff><td colspan=20>&nbsp;</td></tr>"

  end if

  nyear = rs("YearOfMake")
 

 

  '  To insure that every other one is shaded

A
aspbeginner author 3/14/2005

Works Great,

Thanks
Also, Is there a way to use the <hr> or <div> tag instead?

I inserted the following:

nyear = rs("Status")

DO UNTIL rs.eof OR iNumberOfRows>=nPageSize

if nyear <> rs("Status") then

response.write "<hr noshade size=1>"

end if

nyear = rs("Status")
But the hr tag puts the lines above the table list and not in the proper spot and the div tag gives me an error.

A
aspbeginner author 3/22/2005

Sergey, Any way to make this work?

Sergey Kornilov admin 3/23/2005

Try this:

if isObject(rs) then

  ' Pagination: UNTIL iNumberOfRows>=maxrecs

 

  nyear = rs("YearOfMake")

  DO  UNTIL rs.eof OR iNumberOfRows>=nPageSize

  if nyear <> rs("YearOfMake") then

    response.write "<tr height=4 bgcolor=#0000ff><td colspan=20><hr noshade size=1></td></tr>"

  end if

  nyear = rs("YearOfMake") 

 

  '  To insure that every other one is shaded

A
aspbeginner author 3/23/2005

Works Great,

Thanks