Hello, I am having trouble integrating the Jspreadsheet community edition Javascript component into Jmix. I used to be able to do this in CUBA 7.2 using AbstractJavaScriptComponent, JavaScriptComponentState and a Javascript connector. But I can’t get it to work with new approach (https://demo.jmix.io/ui-samples/sample/custom-component-js-library). Probably because I am not very good with Javascript. I would greatly appreciate it if someone can point me in the right direction; maybe more documentation or another example…
I am attaching a sample project. I think my @NpmPackage, @CssImport, and JS import statements are correct. But I can’t get the spreadsheet to show on the Sandbox view.
Spreadsheet.java has Tag annotation with value demo-spreadsheet, but spreadsheet.js is() returns demo-jspreadsheet. they should be same.
I changed it to "demo-spreadsheet"
After that in console i can see error Uncaught ReferenceError: $ is not defined (at least our ui works with the component now)
spreadsheet.js uses jquery $, but do not import it. I add
@NpmPackage(value = "jquery", version = "1.9.1")
@NpmPackage(value = "jquery-ui", version = "1.13.2")
Thank you so much but I’m still unable to get the spreadsheet to show. Console shows error: TypeError: this._spreadsheet.jspreadsheet is not a function. (In 'this._spreadsheet.jspreadsheet({allow...
Is it possible you also made a change in the spreadsheet.js ready() method?
Do not know if it is relevant. But before first start of application i had this problem in idea ui.
After i run application and c.v.f.s.frontend.TaskRunDevBundleBuild : Development frontend bundle built was complited this problem disappeared
Maybe try to delete node_modules directory, for it to be recreated at start of application
Check that NpmPackage imports were added in package.json (it should have been added automatically)