Hello again, @Kerry!
Originally Posted by
Kerry
Only can set the fixed for title, right?
It's not fixed, it is a variable. You need, of course, to get the "GG" or "BaiDu" information off somewhere (like, having an object or array mapping a domain name to a frienly name, or passing in the value).
For instance, to pass the value from the clicked menu entry, you can change the first lines of the client-side function
addTab()
to this:
var addTab = function (tabPanel, id, url, tabTitle, menuItem) {
var tab = tabPanel.getComponent(id);
if (!tab) {
tab = tabPanel.add({
id : id,
title : tabTitle,
And then pass the title along with the other info from the tab, for instance:
<ext:MenuItem runat="server" Text="Ext.NET">
<Listeners>
<Click Handler="addTab(#{TabPanel1}, 'idClt', 'https://ext.net', 'Ext.NET', this);" />
</Listeners>
</ext:MenuItem>
It is also possible to change the tab title after it is added. For that you'd need to add logic to find the tab's
ID
to an unique word, and then you'd be able to
App.ID.setTitle("New Title")
.
It would get a little more complex but it is, of course, possible to get any tab by something unique pertaining it (like the URL it loads) and then assign a title, it is up to you and the view you need to build.
Hope this helps!