Commit f98f56bd by Mac Stephens

fix for officer name bug in unit details, remove back button in summary on unit…

fix for officer name bug in unit details, remove back button in summary on unit details, update small style issues
parent 95124371
[Settings] [Settings]
LogFileNum=554 LogFileNum=557
webClientVersion=0.1.0 webClientVersion=0.1.0
...@@ -101,7 +101,7 @@ type ...@@ -101,7 +101,7 @@ type
[async] procedure ApplyTabAsync(const tabName: string); [async] procedure ApplyTabAsync(const tabName: string);
[async] procedure LoadAsync; [async] procedure LoadComplaintAsync;
[async] procedure LoadMemosAsync; [async] procedure LoadMemosAsync;
[async] procedure LoadHistoryAsync; [async] procedure LoadHistoryAsync;
[async] procedure LoadContactsAsync; [async] procedure LoadContactsAsync;
...@@ -160,7 +160,7 @@ begin ...@@ -160,7 +160,7 @@ begin
FWarningsLoaded := False; FWarningsLoaded := False;
WireUi; WireUi;
LoadAsync; LoadComplaintAsync;
end; end;
procedure TFViewComplaintDetails.WireUi; procedure TFViewComplaintDetails.WireUi;
...@@ -514,7 +514,7 @@ begin ...@@ -514,7 +514,7 @@ begin
ApplyRemarksFilters; ApplyRemarksFilters;
end; end;
[async] procedure TFViewComplaintDetails.LoadAsync; [async] procedure TFViewComplaintDetails.LoadComplaintAsync;
var var
resp: TXDataClientResponse; resp: TXDataClientResponse;
rootObj: TJSObject; rootObj: TJSObject;
......
...@@ -33,6 +33,7 @@ object FViewUnitDetails: TFViewUnitDetails ...@@ -33,6 +33,7 @@ object FViewUnitDetails: TFViewUnitDetails
Header.ListElementClassName = 'pagination' Header.ListElementClassName = 'pagination'
Header.ListItemElementClassName = 'page-item' Header.ListItemElementClassName = 'page-item'
Header.ListLinkElementClassName = 'page-link' Header.ListLinkElementClassName = 'page-link'
WordWrap = True
Columns = < Columns = <
item item
ElementClassName = 'text-nowrap' ElementClassName = 'text-nowrap'
...@@ -95,7 +96,7 @@ object FViewUnitDetails: TFViewUnitDetails ...@@ -95,7 +96,7 @@ object FViewUnitDetails: TFViewUnitDetails
FieldName = 'Status' FieldName = 'Status'
end end
object xdwdsUnitDetailsOfficer1LName: TStringField object xdwdsUnitDetailsOfficer1LName: TStringField
FieldName = 'Officer1LName' FieldName = 'Officer1Lname'
end end
object xdwdsUnitDetailsOfficer1Fname: TStringField object xdwdsUnitDetailsOfficer1Fname: TStringField
FieldName = 'Officer1Fname' FieldName = 'Officer1Fname'
......
...@@ -26,9 +26,6 @@ ...@@ -26,9 +26,6 @@
<div class="card-body py-2"> <div class="card-body py-2">
<!-- Optional: Close/Back row (wire in code) --> <!-- Optional: Close/Back row (wire in code) -->
<div class="d-flex justify-content-end mb-2">
<button type="button" class="btn btn-outline-secondary btn-sm" id="btn_close">Back</button>
</div>
<div class="row gy-1 gx-2"> <div class="row gy-1 gx-2">
<div class="col-5 col-sm-4 fw-semibold text-muted">Car:</div> <div class="col-5 col-sm-4 fw-semibold text-muted">Car:</div>
......
...@@ -43,15 +43,13 @@ type ...@@ -43,15 +43,13 @@ type
FLoading: Boolean; FLoading: Boolean;
procedure InitializeForm; procedure InitializeForm;
procedure WireUi;
procedure CloseClick(Event: TJSEvent);
procedure SetTextById(const elementId, value: string); procedure SetTextById(const elementId, value: string);
procedure SetHiddenById(const elementId: string; hidden: Boolean); procedure SetHiddenById(const elementId: string; hidden: Boolean);
function FormatOfficer(const lname, fname, empnum: string): string; function FormatOfficer(const lname, fname, empnum: string): string;
[async] procedure LoadAsync; [async] procedure LoadUnitAsync;
[async] procedure LoadLogsAsync; [async] procedure LoadLogsAsync;
public public
class function CreateForm(AElementID, UnitId: string): TWebForm; class function CreateForm(AElementID, UnitId: string): TWebForm;
...@@ -91,28 +89,9 @@ begin ...@@ -91,28 +89,9 @@ begin
FLoading := False; FLoading := False;
WireUi; LoadUnitAsync;
LoadAsync;
end; end;
procedure TFViewUnitDetails.WireUi;
var
btnClose: TJSElement;
begin
btnClose := Document.getElementById('btn_close');
if btnClose <> nil then
btnClose.addEventListener('click', @CloseClick);
end;
procedure TFViewUnitDetails.CloseClick(Event: TJSEvent);
begin
Event.preventDefault;
if Assigned(FViewMain) then
begin
FViewMain.SetActiveNavButton('view.main.btnunits');
FViewMain.ShowForm(TFViewUnits);
end;
end;
procedure TFViewUnitDetails.SetTextById(const elementId, value: string); procedure TFViewUnitDetails.SetTextById(const elementId, value: string);
var var
...@@ -154,7 +133,7 @@ begin ...@@ -154,7 +133,7 @@ begin
Result := nameText; Result := nameText;
end; end;
[async] procedure TFViewUnitDetails.LoadAsync; [async] procedure TFViewUnitDetails.LoadUnitAsync;
var var
resp: TXDataClientResponse; resp: TXDataClientResponse;
rootObj: TJSObject; rootObj: TJSObject;
...@@ -177,6 +156,10 @@ begin ...@@ -177,6 +156,10 @@ begin
xdwdsUnitDetails.Close; xdwdsUnitDetails.Close;
xdwdsUnitDetails.SetJsonData(dataObj); xdwdsUnitDetails.SetJsonData(dataObj);
xdwdsUnitDetails.Open; xdwdsUnitDetails.Open;
console.log('Officer1Lname', xdwdsUnitDetails.FieldByName('Officer1Lname').AsString);
console.log('Officer1Fname', xdwdsUnitDetails.FieldByName('Officer1Fname').AsString);
console.log('Officer1Empnum', xdwdsUnitDetails.FieldByName('Officer1Empnum').AsString);
console.log('Officer2Lname', xdwdsUnitDetails.FieldByName('Officer2Lname').AsString);
summaryTitle := xdwdsUnitDetails.FieldByName('UnitName').AsString; summaryTitle := xdwdsUnitDetails.FieldByName('UnitName').AsString;
if Trim(summaryTitle) <> '' then if Trim(summaryTitle) <> '' then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment