Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AddJavaScriptToExecuteAsCDATA vs AddToInitProc
#4
AddToInitProc() is meant to be used in sync requests, while AddJavaScriptToExecute() is meant to be used in async calls.

If your code needs to be shared between sync/async calls, you can use the TIWControlHelper class:

Just declare IWControlHelper in your uses clause and use the extension method:

procedure AddJavaScriptToExecute(const jsCode: string);

This method will be available in all TIWControl descendants (the TIWControlHelper class is a "real" helper class and follows the same rules as any other helper class in Delphi)

So you can use:

IWBSSelect.AddJavaScriptToExecute('$("#MyIWBSSelect").selectpicker("refresh");');
Reply


Messages In This Thread
RE: AddJavaScriptToExecuteAsCDATA vs AddToInitProc - by Alexandre Machado - 05-13-2022, 10:11 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)