Atozed Forums

Full Version: how to call js function from my customAjaxEvent
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code:
// this is my custom ajax event
procedure TdashboardForm.alertChecker(EventParams: TStringList);
var par:Variant;
   today:TDate;
begin
par:=VarArrayOf([
EventParams.Values['noticeID'],
UserSession.UserID,
UserSession.UserName
]);

with UserSession do
begin
//p_reg_sel_NewNotice '201805170000001','9/21/2018'
//p_reg_upd_NoticeRead 201809210000005,201805170000001,'munkhdelger'
 if AdoTool.RunProcedure('p_reg_upd_NoticeRead',par) = fmResult then
 begin
   today:=now;
   par := VarArrayOf([
   UserSession.UserID,
   DateToStr(today)
   ]);
   AdoTool.RunProcedure('p_reg_sel_NewNotice',par);
   AlertHolder.Text := ExportDataSetToJson(AdoTool.DataResult,0);
//How to call my callme(); in js from here tjhi


   WebApplication.ShowNotification('Амжилттай');
 end
 else
 begin
   WebApplication.ShowNotification('Амжилтгүй');
 end;
end;
Hi, something like this:

Code:
WebApplication.CallBackResponse.AddJavaScriptToExecute( '$("#EditModal").modal("hide");' );
(09-21-2018, 11:22 AM)Jose Nilton Pace Wrote: [ -> ]Hi, something like this:

Code:
WebApplication.CallBackResponse.AddJavaScriptToExecute( '$("#EditModal").modal("hide");' );
thank you it works, also how to get customajaxevent response?