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]
LogFileNum=554
LogFileNum=557
webClientVersion=0.1.0
......@@ -101,7 +101,7 @@ type
[async] procedure ApplyTabAsync(const tabName: string);
[async] procedure LoadAsync;
[async] procedure LoadComplaintAsync;
[async] procedure LoadMemosAsync;
[async] procedure LoadHistoryAsync;
[async] procedure LoadContactsAsync;
......@@ -160,7 +160,7 @@ begin
FWarningsLoaded := False;
WireUi;
LoadAsync;
LoadComplaintAsync;
end;
procedure TFViewComplaintDetails.WireUi;
......@@ -514,7 +514,7 @@ begin
ApplyRemarksFilters;
end;
[async] procedure TFViewComplaintDetails.LoadAsync;
[async] procedure TFViewComplaintDetails.LoadComplaintAsync;
var
resp: TXDataClientResponse;
rootObj: TJSObject;
......
......@@ -33,6 +33,7 @@ object FViewUnitDetails: TFViewUnitDetails
Header.ListElementClassName = 'pagination'
Header.ListItemElementClassName = 'page-item'
Header.ListLinkElementClassName = 'page-link'
WordWrap = True
Columns = <
item
ElementClassName = 'text-nowrap'
......@@ -95,7 +96,7 @@ object FViewUnitDetails: TFViewUnitDetails
FieldName = 'Status'
end
object xdwdsUnitDetailsOfficer1LName: TStringField
FieldName = 'Officer1LName'
FieldName = 'Officer1Lname'
end
object xdwdsUnitDetailsOfficer1Fname: TStringField
FieldName = 'Officer1Fname'
......
......@@ -26,9 +26,6 @@
<div class="card-body py-2">
<!-- 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="col-5 col-sm-4 fw-semibold text-muted">Car:</div>
......
......@@ -43,15 +43,13 @@ type
FLoading: Boolean;
procedure InitializeForm;
procedure WireUi;
procedure CloseClick(Event: TJSEvent);
procedure SetTextById(const elementId, value: string);
procedure SetHiddenById(const elementId: string; hidden: Boolean);
function FormatOfficer(const lname, fname, empnum: string): string;
[async] procedure LoadAsync;
[async] procedure LoadUnitAsync;
[async] procedure LoadLogsAsync;
public
class function CreateForm(AElementID, UnitId: string): TWebForm;
......@@ -91,28 +89,9 @@ begin
FLoading := False;
WireUi;
LoadAsync;
LoadUnitAsync;
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);
var
......@@ -154,7 +133,7 @@ begin
Result := nameText;
end;
[async] procedure TFViewUnitDetails.LoadAsync;
[async] procedure TFViewUnitDetails.LoadUnitAsync;
var
resp: TXDataClientResponse;
rootObj: TJSObject;
......@@ -177,6 +156,10 @@ begin
xdwdsUnitDetails.Close;
xdwdsUnitDetails.SetJsonData(dataObj);
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;
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