EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: JPi on October 13, 2016, 09:19:34 PM



Title: Is dynamic tab title possible ?
Post by: JPi on October 13, 2016, 09:19:34 PM
Hi,

I have a scenario where there are 3 tabs. Eg. Inbox, LeaveApply and HolidayList.

In Inbox tab, there is a datagrid showing list of new mails and the count of unread mails need to be displayed in bracket like Inbox (5) which means there are 5 unread mails. While a user works on LeaveApply tab and the user's unread mailbox count increases to 7 then how to dynamically display Inbox (7) without navigating to Inbox tab. I need to show dynamic title for Inbox while working on other tabs.

Is this possible and if so how ?

Thanks,
JPi


Title: Re: Is dynamic tab title possible ?
Post by: stworthy on October 14, 2016, 12:10:17 AM
You can call 'update' method to update the title of a specified tab panel.
Code:
var t = $('#tt');  // the tabs object
var tab = t.tabs('getTab', 0);  // the first tab panel i.e. Inbox
t.tabs('update', {
  tab: tab,
  options: {
    type: 'header',
    title: 'Inbox(5)'
  }
});


Title: Re: Is dynamic tab title possible ?
Post by: JPi on October 14, 2016, 02:20:43 AM
Thanks stworthy. I shall try it.