// Item object and the index argument passed into the addTab method to add a new tab
tabObj.addTab([item], totalItems -1);
tabObj.selectedItem = totalItems -1;
Above sample is for your reference and the same can be achieved in Core.
BJBernard JurlinaMay 18, 2019 01:43 AM
thanks, it's working. But, when I add new tab from code and populate it with some html and I want to close that new tab, I cannot change
selectedItem back to first.
The scenario is like this.
First, click on the button creates new tab and loads html inside.
Then I want to close that tab...but...
the tab is closed, and selected tab is not the first one.
I tried with onTabRemoved and onTabRemoving, but the results are the same. It will not select back the first tab.
That's the first problem. The second is that I want to disable closing the first tab. I tried with first if statement in method onTabRemoving,
but the tab closes anyway.
NRNevitha Ravi Syncfusion Team May 20, 2019 04:38 AM
Thanks for your update.
We have checked the reported scenario ‘after closing the new tab, first tab is not selected’ at our end and were unable to reproduce the problem. We have shared the video demo for the same which can be downloaded from the following link.