[Pas2js] bootstrap 5 modal: JQuery(...).modal is not a function

Luca Olivetti luca at ventoso.org
Fri Aug 11 10:28:03 CEST 2023


since I need to show/hide a bootstrap 5 modal, I thought I could use the 
TBootstrapModal defined in bootstrapwidgets, however it gives the 
exception in the subject: "JQuery(...).modal is not a function.
This comes from ApplyWidgetSettings:


since TBootstrap is defined as a class helper for TJQuery.

I'm not an expert in web technologies, but I guess this is due to the 
fact that libbootstrap is for bootstrap 4 and I'm using bootstrap 5.

For the time being I'm using a very minimal wrapper for the modal (since 
I only need to show/hide it from my application):

   TBootstrapModal = class external name 'bootstrap.Modal' (TJSObject)
     constructor new(element: TJSObject{; options: JSValue});
     procedure hide;
     procedure show;


More information about the Pas2js mailing list