Atozed Forums
how to call js function from my customAjaxEvent - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: how to call js function from my customAjaxEvent (/thread-684.html)



how to call js function from my customAjaxEvent - morhous - 09-21-2018

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;



RE: how to call js function from my customAjaxEvent - Jose Nilton Pace - 09-21-2018

Hi, something like this:

Code:
WebApplication.CallBackResponse.AddJavaScriptToExecute( '$("#EditModal").modal("hide");' );



RE: how to call js function from my customAjaxEvent - morhous - 09-26-2018

(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?