Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
External JS with template
#1
My application using HTML bootstrap templates with datatables.

I will insert whis javascript: https://datatables.net/extensions/dateti...datatables

To much source for execute with WebApplication.CallBackResponse.AddJavaScriptToExecute!

Is there a change implement with external .js file?
Reply
#2
You can just copy the whole JS content to a file, name it whatever you want (E.g. "CustomDataTable.js") and save it inside application's wwwroot folder.

Then you add it to the IWForm's ContentFiles at design time or at run time, with no path (because it is relative to wwwroot folder):

procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
ContentFiles.Add('CustomDataTable.js');
end;

If you want to see other uses of DataTables with IntraWeb I suggest you try this example as well:

(it shows some other features that you may not need, but focus on the DataTables usage)

https://github.com/Atozed/IntraWeb/tree/...nsNoCookie
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)