OSDN Git Service

admin tableのデザインを見直した
authoryamat0jp <terukohietori@gmail.com>
Tue, 21 Jan 2020 09:06:19 +0000 (18:06 +0900)
committeryamat0jp <terukohietori@gmail.com>
Tue, 21 Jan 2020 09:06:19 +0000 (18:06 +0900)
WebModuleUnit1.dfm
WebModuleUnit1.pas

index a88c810..0d6dea3 100644 (file)
@@ -197,7 +197,7 @@ object WebModule1: TWebModule1
   object admin: TDataSetTableProducer
     Columns = <
       item
-        Title.Caption = 'check'
+        FieldName = 'CHECK'
       end
       item
         FieldName = 'NUMBER'
@@ -215,6 +215,10 @@ object WebModule1: TWebModule1
       '')
     MaxRows = 30
     DataSet = FDTable2
+    RowAttributes.Align = haCenter
+    TableAttributes.Align = haCenter
+    TableAttributes.BgColor = 'White'
+    TableAttributes.Width = 80
     OnFormatCell = adminFormatCell
     Left = 176
     Top = 32
@@ -2046,6 +2050,7 @@ object WebModule1: TWebModule1
   object FDConnection1: TFDConnection
     Params.Strings = (
       'ConnectionDef=first_sql')
+    Connected = True
     Left = 632
     Top = 56
   end
index cb2cbbc..1f7e518 100644 (file)
@@ -198,8 +198,18 @@ procedure TWebModule1.adminFormatCell(Sender: TObject;
   var Align: THTMLAlign; var VAlign: THTMLVAlign;
   var CustomAttrs, CellData: string);
 begin
-  if (CellColumn = 0) and (CellRow > 0) then
-    CellData := Format('<input name=check%d type=checkbox>', [CellRow]);
+  if CellRow = 0 then
+    Exit;
+  case CellColumn of
+    0:
+      CellData := Format('<input name=check%d type=checkbox>', [CellRow]);
+    1:
+      CellData := '<b>' + CellData + '</b>';
+    2:
+      CellData := '<p style=color:red>' + CellData + '</p>';
+    3:
+      CellData := '<p style=color:green>' + CellData + '</p>';
+  end;
 end;
 
 procedure TWebModule1.alertHTMLTag(Sender: TObject; Tag: TTag;
@@ -1329,6 +1339,7 @@ begin
       '<h1 style=color:maron;text-align:center;font-style:italic>\82Æ\82é\82Ë\81`\82Ç\8d\86</h1>',
       0, i, 30, hash(hash('admin')), s]);
   end;
+  admin.MaxRows:=FDTable3.FieldByName('count').AsInteger;
 end;
 
 end.