how to call js function from my customAjaxEvent

<< Click to Display Table of Contents >>

Navigation:  Forum >

how to call js function from my customAjaxEvent

Forum link

 


 

09-21-2018, 06:37 AM:

 

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;

 

 

 


 

09-21-2018, 11:22 AM:

 

Hi, something like this:

 

Code:

 

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

 

 

 


 

09-26-2018, 06:31 AM:

 

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