1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    9
    Vote Rating
    0
    dasara is on a distinguished road

      0  

    Default How to Close a TabPanelItem by clicking on the tab

    How to Close a TabPanelItem by clicking on the tab


    Hi Everybody,
    I'm using YAHOO.ext.TabPanel and creating tabs dynamically by using addTab(). And i want to close the tab by clicking on the tab.
    Could anyone tell me how can we close a tabPanelItem by clicking on tab. Is there any way to display a HTML page in a dynamically created tab.

    Thanks in advance,

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    57
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    You can make it closable: http://www.yui-ext.com/deploy/yui-ex...el.html#addTab

    You can execute a function of your own choosing before the close event takes place: http://www.yui-ext.com/deploy/yui-ex...nt-beforeclose

    You can update the tab's Element using this sequence:

    http://www.yui-ext.com/deploy/yui-ex...em.html#bodyEl

    http://www.yui-ext.com/deploy/yui-ex...nt.html#update

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    9
    Vote Rating
    0
    dasara is on a distinguished road

      0  

    Default How to get the content from a dynamically added tab

    How to get the content from a dynamically added tab


    Thanks Mr. Animal.
    its working. I'm able to close the tab and displaying the html content.

    But now i want to get the content from the tab body which was dynamically set to the TabPanelItem.

    Is there any way to retrieve the content from the tab body which was dynamically set to the TabPanelItem when the Tab is added using addTab() method.
    it will be very helpful for me. For last two days i was working on that. But i couldnot Achieve it.

    Thanks in advance.

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    57
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    So how do you put the HTML there in the first place?

    You can always insert your own code into the process using listeners and capture the content.

    Access the UpdateManager of the body element:

    Code:
    var um = myTab.bodyEl.getUpdateManager();
    um.on("update".....
    http://www.yui-ext.com/deploy/yui-ex...l#event-update

    Or you could set your own renderer for the body element's UpdateManager, and do what you want with the content:

    http://www.yui-ext.com/deploy/yui-ex...ml#setRenderer

    Really, you should read the docs, hack, look at source code, trace it through in Firebug. Don't rely on other people: http://www.yui-ext.com/deploy/yui-ext/docs/

  5. #5
    Ext User
    Join Date
    Apr 2007
    Posts
    1
    Vote Rating
    0
    alitoch is on a distinguished road

      0  

    Default


    Hello,
    I'm new on the forum. I was asking myself... all that stuff with TabPanel information retrieve is very good, but... is it possible to do the same when you have tabs without a tabpanel ?
    I've made a code with a structured BorderLayout and many contentPanels in one Layout. Here is the code :
    Code:
    layout.add('center', new Ext.ContentPanel('content', {title: 'Index', closable: false}));
        layout.add('center', new Ext.ContentPanel('tab1', {title: 'first tab', closable: true}));
        layout.add('center', new Ext.ContentPanel('tab2', {title: 'second tab', closable: true}));
        layout.add('center', new Ext.ContentPanel('tab3', {title: 'third tab', closable: true}));
    Ext creates automatically for me a TabPanel filled by 3 tabs on top of my "content" ContentPanel. Excellent, but I have no way to retrieve these tabs to do some actions on it.
    Actually, I'd like to make the tab handlers (these you click on to activate/select a tab) draggable. Is it possible ?

    Thanks,
    alitoch

Similar Threads

  1. Fires in Ext.TabPanelItem
    By cebola in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 27 Mar 2007, 7:42 AM
  2. Bug or not with TabPanelItem
    By reignman in forum Ext 1.x: Bugs
    Replies: 1
    Last Post: 5 Feb 2007, 7:17 AM
  3. close a TabPanelItem
    By punitshah in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 25 Jan 2007, 12:10 AM
  4. fitToForm in a TabPanelItem in a Region
    By Animal in forum Ext 1.x: Bugs
    Replies: 7
    Last Post: 30 Nov 2006, 4:52 AM
  5. Clicking Next Page While Focused In Editor Cell
    By thejoker101 in forum Ext 1.x: Bugs
    Replies: 1
    Last Post: 21 Nov 2006, 8:40 AM

Thread Participants: 2