EasyUI Forum
March 29, 2024, 05:49:46 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Stop the TabPanelComponent from closing after the X is clicked.  (Read 5826 times)
Swany
Newbie
*
Posts: 44


View Profile Email
« on: April 23, 2018, 01:44:14 PM »

I don't see a before tab closing event. So is there another way to stop the tab panel component from closing after the X is pressed. Example is if the user clicks on the X and we check to see if the form is dirty. If it is than show a message box and keep the tab from closing if they select to stop closing the tab.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2260


View Profile Email
« Reply #1 on: April 23, 2018, 11:37:00 PM »

You can custom the tab panel header. Define your own 'closeTab' method to close the panel.
Code:
<eui-tab-panel #p1>
<ng-template euiHeaderTemplate>
<span class="tabs-title tabs-closable">tab2</span>
<a href="javascript:;" class="tabs-close" (click)="closeTab(p1)"></a>
</ng-template>
</eui-tab-panel>
Code:
closeTab(panel){
panel.close();
}
Logged
Swany
Newbie
*
Posts: 44


View Profile Email
« Reply #2 on: April 24, 2018, 08:26:36 AM »

Works great thank you for your help.

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!