Browse Source

* Patch from heliosroots. Closes merge request cd pas2js/

Michael Van Canneyt 3 years ago
parent
commit
2799118b26
2 changed files with 12 additions and 1 deletions
  1. 3 1
      packages/webwidget/htmlwidgets.pp
  2. 9 0
      packages/webwidget/webwidget.pas

+ 3 - 1
packages/webwidget/htmlwidgets.pp

@@ -696,7 +696,7 @@ Type
   Public
     Constructor Create(aTable : TCustomTableWidget;aTableID : String); virtual;
     Property Table : TCustomTableWidget Read FTable;
-    Property Column : TCustomTableColumn Read FColumn;
+    Property Column : TCustomTableColumn Read FColumn Write FColumn;
     Property Row : Integer Read FRow;
     Property Col : Integer Read FCol;
     Property Kind : TRowKind Read FKind;
@@ -3184,3 +3184,5 @@ end;
 
 end.
 
+
+

+ 9 - 0
packages/webwidget/webwidget.pas

@@ -377,6 +377,7 @@ Type
     Class Function FindElement(aID : String) : TJSHTMLElement;
     // Create element in DOM tree, set ID if it is nonzero
     Class function CreateElement (aTag : String; aID : String) : TJSHTMLElement;
+    Class function CreateElement (aParent:TJSElement; aTag : String; aID : String) : TJSHTMLElement;
     // references are relative to this element. By default, this is the element of the widget.
     // override if you want for instance to indicate the parent element.
     function GetReferenceElement: TJSHTMLELement; virtual;
@@ -2737,6 +2738,14 @@ begin
     Result.id:=aID;
 end;
 
+class function TCustomWebWidget.CreateElement(aParent: TJSElement; 
+  aTag: String; aID: String): TJSHTMLElement;
+begin
+  Result := CreateElement(aTag, aID);
+  if aParent <> nil then
+    aParent.appendChild(Result);
+end;
+
 function TCustomWebWidget.GetReferenceElement: TJSHTMLELement;
 begin
   Result:=Element;