Add List to Custom Widget

558
4
03-01-2022 09:54 AM
MichaelWen_Timmons
New Contributor III

I'm developing a custom widget that has tabs. I'd like to add a List, like the List Widget, to one of the tabs. Is there a simple way to embed a basic widget inside a custom widget? If not is reusing the code under the \dist\widgets\common\list folder structure the best way to proceed?

Thanks.

0 Kudos
4 Replies
jcarlson
MVP Esteemed Contributor

Is there a reason you can't just use a Section element and associated View Navigator to handle the tabs?

- Josh Carlson
Kendall County GIS
0 Kudos
MichaelWen_Timmons
New Contributor III

We're trying to embed all custom logic inside a custom widget. If a Section widget can be incorporated into the custom widget then that would work too.

0 Kudos
RyanDickinson1
New Contributor III

Michael, can you not call a method to instantiate the Section or List widget from the HTML in the custom widget?

 

I did something like this using import { Tabs, Tab} from "jimu-ui"; then in the html use whatever you like to call the method.

 

RyanDickinson1_0-1646324679217.png

 

0 Kudos
MichaelWen_Timmons
New Contributor III

I want renderTableData() to display a list that has most of the functionality of the List widget. That's the tricky part.

0 Kudos