Page 1 of 1

[INFO REQ] TabPanel with closeable Tab

Posted: Tue Oct 04, 2022 6:46 pm
by luizatslog

Hi, how do I add a close button on a Tab to use in TabPanel?


Re: [INFO REQ] TabPanel with closeable Tab

Posted: Tue Oct 04, 2022 7:31 pm
by marcio

Hey luizatslog,

You can add an icon to the tab like this

new TabPanel({
    appendTo : document.body,
    height   : '14em',
    items    : [
        {
            title : 'One',
          
tab : { icon : 'b-fa b-fa-times', iconAlign: 'end' }, // other configs... }, { title : 'Two', items : [ { type : 'widget', html : 'Second' } ] }, { title : 'Three', items : [ { type : 'widget', html : 'Last' } ] } ] });

You probably will need to set a listener to click and then remove the tab programmatically.

Check the available options here https://www.bryntum.com/docs/grid/api/Core/widget/Tab