EasyUI Forum
April 19, 2024, 11:43:10 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to dynamically create a tabpanelcomponent and add it to an existed Tabs?  (Read 7775 times)
softboy99
Newbie
*
Posts: 43


View Profile Email
« on: February 02, 2018, 02:17:14 AM »

I use the way of angular dynamic loading. But failed with the following:

core.js:1440 ERROR Error: StaticInjectorError(AppModule)[TabPanelComponent -> TabsComponent]:
  StaticInjectorError(Platform: core)[TabPanelComponent -> TabsComponent]:
    NullInjectorError: No provider for TabsComponent!
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: February 02, 2018, 07:12:13 PM »

Please look at this example https://www.jeasyui.com/demo-angular/main/index.php?plugin=Tabs&theme=material&dir=ltr&pitem=Dynamic%20Tab%20Content&sort=
Logged
softboy99
Newbie
*
Posts: 43


View Profile Email
« Reply #2 on: February 03, 2018, 03:00:48 AM »

Thanks a lot. In the sample, each time click "adddatagrid" button, it will add a new tab. Is it possible just allow the first time, when 2nd time or later just make the former 1st added tab active.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #3 on: February 03, 2018, 06:19:00 PM »

That's simple, you can detect the existing tab panel. If not create it otherwise select it. For more information please look at the example in previous post.
Logged
softboy99
Newbie
*
Posts: 43


View Profile Email
« Reply #4 on: February 04, 2018, 10:35:42 PM »

Is it possible to use component name string "Dy1Component" to load component, so that AppComponent doesn't depend on Dy1Component. Because may be there many commponents.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!