Hi,
I’m struggling with integration of a third party jQuery plugin with properties panel. I followed well written tutorial on camunda blog. Extension was easy with default factory items. Once I decided to replace SelectEntryFactory with jQuery plugin Select2, things got a little bit complicated…
I debugged property panel generation line by line, but I didn’t find any event firing after panel properties are inserted to DOM. Is there a way how to capture the event and instantiate plugin after element addition to DOM? My current solution includes lodash delay function and component initialization after a period of time, even if I’m not happy about this solution.
My second problem is a plugin integration with Modeler. I installed both jQuery (v. 3.2.1) and Select 2 (v. 4.0.6-rc.1) npm packages and inserted them to custom Select2EntryFactory with require module as following:
var $ = require("jquery"),
select2 = require("select2");
Both modules are available and require.resolve returns a correct path of javascript files. When I try to instantiate select2, jQuery is available and selects target element correctly, but select2 initialization function $(’#id’).select2(); is not available with message “.select2 is not a function”. I tried to add jQuery to window object with both jQuery and $ properties, but plugin initialization can’t find a select2 function anyway. I’m new to electron / node development world and I’m not sure where I made a mistake.
I saw there were some posts asking similar question about select2 trigger event, but without a final solution.
Can you guys point me out in a correct direction and help me with custom plugin integration?
Thanks a lot!
Have a nice day