Problems using the spreadsheet module in an existing project
dberardo-com opened this issue · 4 comments
so, i have been able to start the demo environment. what i would like to do next, is to embed the spreadsheet within an existing javascript / react project.
basically i want to use the spreadsheet by simpling importing the right objects from the right packages ... but i am failing badly.
indeed if i look at the index.html demo file i see a lot of imports from compiled folders like node_modules or build/, but what i am aiming for is to mount the spreadsheet without doing any pre-compilation.
unfortunately the demo example is too complex to follow through, and there are certain variable which are sort of "magically" appearing, like the o_spreadsheet and owl variables.
i get from the rollup configurations the owl is an alias, so i can use its package instead to import elements, that is instead of doing "const {...stuff} = owl" i can do "import {stuff} from @owl/..." which is ok, but i have no idea where the o_spreadsheet module is defined. any hint ?
also: is there simpler, minimal example to get started in this sense ? the demo one is quite extensive
in particular, the latest error i am facing is something like:
Error: Cannot find the definition of component "Spreadsheet", missing static components key in parent at owl.es.js:5705:31
and i see nothing being mounted on screen
i have managed to come somewhat further, indeed this was the crucial part to start a new minimal spreadsheet:
let model = new Model(data) // <-- here one can use data.js from the demo
const rootApp = new owl.App(Spreadsheet, { props: { model } });
rootApp.addTemplates(templates); // <-- this are the templates from the .xml demo file
rootApp.mount(document.body, {})
... cleanup
rootApp.destroy()
In the end, did you manage posting this simple example in existing js / react project?