mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-21 13:39:20 +02:00
* Set field value on change
This commit is contained in:
parent
cfe1da9cb6
commit
f6aa05353b
@ -124,8 +124,10 @@ Type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
TDBCustomHTMLInputElementAction = class(TDBCustomHTMLElementAction)
|
TDBCustomHTMLInputElementAction = class(TDBCustomHTMLElementAction)
|
||||||
|
private
|
||||||
Protected
|
Protected
|
||||||
procedure DoKeyDown(aEvent: TJSEvent); override;
|
procedure DoKeyDown(aEvent: TJSEvent); override;
|
||||||
|
procedure DoEditChange(aEvent: TJSEvent); virtual;
|
||||||
Procedure ActiveChanged; override;
|
Procedure ActiveChanged; override;
|
||||||
function NeedsClick(aEl: TJSElement): Boolean;
|
function NeedsClick(aEl: TJSElement): Boolean;
|
||||||
Procedure StartEditing; override;
|
Procedure StartEditing; override;
|
||||||
@ -525,9 +527,17 @@ begin
|
|||||||
aEl.addEventListener(sEventKeyDown,@DoKeyDown);
|
aEl.addEventListener(sEventKeyDown,@DoKeyDown);
|
||||||
if NeedsClick(aEl) then
|
if NeedsClick(aEl) then
|
||||||
aEl.addEventListener(sEventClick,@DoKeyDown);
|
aEl.addEventListener(sEventClick,@DoKeyDown);
|
||||||
|
aEl.addEventListener(SEventChange,@DoEditChange);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TDBCustomHTMLInputElementAction.DoEditChange(aEvent : TJSEvent);
|
||||||
|
|
||||||
|
begin
|
||||||
|
if Link.Edit then
|
||||||
|
ElementToDataset;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TDBCustomHTMLInputElementAction.DoKeyDown(aEvent : TJSEvent);
|
procedure TDBCustomHTMLInputElementAction.DoKeyDown(aEvent : TJSEvent);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user