sp; for i = 0 to index - 1 select case lcase(nItems(i).Columntype) Case "label" strTable = strTable & "<td " & nItems(i).HTMLstr & ">" & rs(nItems(i).field) &"</td>" Case "radio" Case "image" Case "checkbox" Case "textbox" strTable = strTable & "<td " & nItems(i).HTMLstr &"><input type=text value=" & rs(nItems(i).field) &"></td>" Case "link" Case "edit" if UniqueField="" then ErrorMsg="UniqueField not set" strTable = strTable & "<td " & nItems(i).HTMLstr & "><a href=" & actionURL & "&dg_action=edit&uniquekey=" & rs(UniqueField) & ">" & nItems(i).EditCommandText & "</a></td>" Case "delete" if UniqueField="" then ErrorMsg="UniqueField not set" strTable = strTable & "<td " & nItems(i).HTMLstr &"><a href=" & actionURL & "&dg_action=delete&uniquekey=" & rs(UniqueField) &">" & nItems(i).DeleteCommandText&"</a></td>" Case "update" Case else strTable = strTable & "<td " & nItems(i).HTMLstr &">" & rs(nItems(i).Field) & "</td>" End select Next End if ''''End if rs.movenext strTable = strTable & "</tr>"& vbcrlf loop if PagePosition="down" or PagePosition="updown" then strTable = strTable & "<tr><td colspan="& index &">"& page(rs.PageCount,Pagenumber,currPage ) ''''strTable =strTable&"<tr>" for i = 0 to index - 1 if nItems(i).Columntype<>"edit" and nItems(i).Columntype <> "delete" and not nItems(i).readonly and nItems(i).field<>uniquefield then ''''strTable = strTable & "<td " & nItems(i).HTMLstr &"><input type=Text name=""" & rs.Fields(nItems(i).field).Name &"""></td>" else ''''strTable = strTable & "<td " & nItems(i).HTMLstr &"> </td>" end if next strTable =strTable&"</tr>" strTable = strTable & "</form></table>" If isAddnew = 1 then strTable = strTable & "<form action=""?dg_action=addnew"" name=""dgridadd"" method=""post""><table border=" & intBorderWidth & " bordercolordark=" & strBorderColorDark & " bordercolorlight=" & strbordercolorlight & " cellspacing=0><tr>" for i = 0 to index - 1 if nItems(i).Columntype<>"edit" and nItems(i).Columntype <> "delete" and not nItems(i).readonly and nItems(i).field<>uniquefield then strTable = strTable & "<td " & nItems(i).HTMLstr &">" & rs.Fields(nItems(i).field).Name &"</td>" else ''''strTable = strTable & "<td " & nItems(i).HTMLstr &">"&nItems(i).Title&"</td>" end if next strTable = strTable & "<td rowspan=2><a href=""JavaScript:document.dgridadd.submit()"">New</a></td></tr><tr>" for i = 0 to index - 1 if nItems(i).Columntype<>"edit" and nItems(i).Columntype <> "delete" and not nItems(i).readonly and nItems(i).field<>uniquefield then strTable = strTable & "<td " & nItems(i).HTMLstr &"><input type=Text name=""" & rs.Fields(nItems(i).field).Name &"""></td>" & vbcrlf else ''''strTable = strTable & "<td " & nItems(i).HTMLstr &"> </td>" end if next strTable = strTable &"</tr></table></form>" End if Response.Write strTable End Sub Public Sub AddColumn(cColumn) ''''set tem = new Column ''''tem = cColumn ''''response.Write cColumn.ColumnHTMLstr Columns.Add index,cColumn index = index + 1 ''''Columns.Items(i) End Sub End Class Class Column Private strType Private strAlign Private strStyle Private ColumnText Private intWidth Private intHight Private strfield Private strTitle Private strEvent Private strCssClass Private strText Private strEditCommandText,strUpdateCommandText,strCancelCommandText,strDeleteCommandText Private strRegExp Private strReadOnly Private strDataType Public MaxValue,MinValue,MaxLength,MinLength,IsEmpty,IsChar,IsNumber,isCharNumber,isDate,isEmail Private Sub Class_Initialize() ColumnType = "Text" strEditCommandText = "EDIT" strUpdateCommandText = "UPDATE" strCancelCommandText = "CANCEL" strDeleteCommandText = "DELETE" End Sub Private Sub Class_Terminate() End Sub Public Property Let Columntype(Value) strType = lcase(Value) End Property Public Property Get Columntype() ColumnType = strType End Property Public Property Let Para(Value) Para = Value End Property Public Property Let ParaLink(Value) ParaLink = Replace(Value,"{0}",Para) End Property Public Property Let ControlName(Value) ControlName = Value End Property Public Property Let Style(Value) strStyle = Value End Property Public Property Let Eventstr(Value) strEvent = Value End Property Public Property Let Align(Value) strAlign = Value End Property Public Property Get Align() Align = strAlign End Property Public Property Get Eventstr() Eventstr = strEvent End Property Public Property Let Width(Value) intWidth = Value End Property Public Property Let Field(Value) strField = lcase(Value) End Property Public Property Get Field() Field = strField End Property &n
上一页 [1] [2] [3] [4] 下一页 |