2
0

fgmindex.pas 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. unit fgmIndex;
  2. {$mode ObjFPC}
  3. interface
  4. uses
  5. SysUtils, Classes, js, Rtl.HTMLActions, htmlfragment, Data.HTMLActions,
  6. jsondataset, localjsondataset, DB, Web;
  7. type
  8. { ThfgmIndex }
  9. ThfgmIndex = class(THTMLFragment)
  10. actbtnCancel: TDBHTMLButtonElementAction;
  11. actbtnEdit: TDBHTMLButtonElementAction;
  12. actbtnFirst: TDBHTMLButtonElementAction;
  13. actbtnLast: TDBHTMLButtonElementAction;
  14. actbtnNext: TDBHTMLButtonElementAction;
  15. actbtnPost: TDBHTMLButtonElementAction;
  16. actbtnPrevious: TDBHTMLButtonElementAction;
  17. actedtCode: TDBHTMLInputElementAction;
  18. actedtName: TDBHTMLInputElementAction;
  19. alIndex: THTMLElementActionList;
  20. actBtnAppend: TDBHTMLButtonElementAction;
  21. dsCountries: TDataSource;
  22. HTMLElementAction1: THTMLElementAction;
  23. jdsCountries: TLocalJSONDataset;
  24. jdsCountriescode: TStringField;
  25. jdsCountriesName: TStringField;
  26. procedure DataModuleRendered(Sender: TObject);
  27. procedure DoAutoEdit(Sender: TObject; Event: TJSEvent);
  28. private
  29. public
  30. end;
  31. var
  32. hfgmIndex: ThfgmIndex;
  33. countrycodes : TJSArray; external name 'countrycodes';
  34. implementation
  35. {$R *.lfm}
  36. { ThfgmIndex }
  37. procedure ThfgmIndex.DataModuleRendered(Sender: TObject);
  38. begin
  39. alIndex.Bind;
  40. jdsCountries.Rows:=countrycodes;
  41. jdsCountries.Open;
  42. end;
  43. procedure ThfgmIndex.DoAutoEdit(Sender: TObject; Event: TJSEvent
  44. );
  45. begin
  46. dsCountries.AutoEdit:=TJSHTMLInputElement(HTMLElementAction1.Element).checked;
  47. end;
  48. end.