* Fixed demorouter example

This commit is contained in:
michael 2021-03-22 12:59:37 +00:00
parent 513de6c6e3
commit 8fb7a9ba3d
2 changed files with 13 additions and 8 deletions

View File

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions BuildModesCount="1">
<ProjectOptions>
<Version Value="12"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
@ -13,8 +14,8 @@
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes>
<Item1 Name="Default" Default="True"/>
<BuildModes Count="1">
<Item1 Name="default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
@ -25,7 +26,7 @@
<Mode0 Name="default"/>
</Modes>
</RunParams>
<Units Count="2">
<Units Count="3">
<Unit0>
<Filename Value="demorouter.pas"/>
<IsPartOfProject Value="True"/>
@ -34,12 +35,16 @@
<Filename Value="frmdemo.pp"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="demorouter.html"/>
<IsPartOfProject Value="True"/>
</Unit2>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="demorouter"/>
<Filename Value="demorouter.js" ApplyConventions="False"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>

View File

@ -34,7 +34,7 @@ end;
function TDemoForm.ButtonClick(Event: TJSMouseEvent): boolean;
begin
Router.Push(Event.target['data']);
Router.Push(String(TJSHTMLElement(Event.target).Dataset['link']));
end;
constructor TDemoForm.Create(aFormNo: Integer; UseSlash: Boolean);
@ -85,7 +85,7 @@ begin
Button:=TJSHTMLElement(document.createElement('button'));
Button['class']:='btn btn-default';
Button.InnerHTML:='Go to form '+IntToStr(i);
Button['data']:=MakeLink(i,false);
Button.Dataset['link']:=MakeLink(i,false);
Button.onclick:=@ButtonClick;
PanelContent.appendChild(Button);
end;
@ -95,7 +95,7 @@ end;
function TDemoForm.DoLinkClick(aEvent: TJSMouseEvent): boolean;
begin
Router.Push(aEvent.target['href']);
Router.Push(String(aEvent.target['href']));
end;
end.