odoo / owl

OWL: A web framework for structured, dynamic and maintainable applications
https://odoo.github.io/owl/
Other
1.1k stars 332 forks source link

Question: Mounting component with javascript #1592

Closed pumppi closed 4 months ago

pumppi commented 4 months ago

Hi,

I'm working on Odoo 16 version and custom implemented ui elements with OWL. We are using for example https://datatables.net/ table for displaying specific data for user and using some datatables plugins.

When we are rendering Datatables rows we want to render OWL component. My question is: How to mount component from javascript I know that there is possibility to do this by App class, but how about multiple App classes. Is it okey?:

This is what we have now used:

detailsRowCreated(td, cellData, rowData, row, col){
        let wrapper = new ComponentWrapper(null, OwlComponent, {});
        wrapper.mount(td);
}
sdegueldre commented 4 months ago

Hello, the issues on this repo are for reporting issues with Owl itself or its documentation. It appears you're asking about using Owl within Odoo, a better place to ask would be the Odoo forums.

To answer the part of your question about Owl itself: having multiple Apps mounted at the same time is completely fine, though you need to be careful of configuring each new app correctly and you're resonsible for coordinating the multiple apps together.

pumppi commented 3 months ago

Thanks.

If multiple apps fine then thats okey. Need to just handle lifecycles etc...