1. #1
    Ext User karacutey's Avatar
    Join Date
    Nov 2008
    Posts
    46
    Vote Rating
    0
    karacutey is on a distinguished road

      0  

    Default GXT auto resizing tabs

    GXT auto resizing tabs


    is there any way to be able to have a tabpanel automatically resize the width of a tab to match the length of the tab title. I didn't see a method like setAutoTabWidth or something like that. this would be a nice method.

    thankx in advance

    kara

  2. #2
    Ext User fulvius's Avatar
    Join Date
    Nov 2007
    Posts
    20
    Vote Rating
    0
    fulvius is on a distinguished road

      0  

    Question tricks to solve tabPanel resize bug? anybody?

    tricks to solve tabPanel resize bug? anybody?


    yeah... some annoying problems occurs with tabPanel when resize the window.

    Look

    And the layout back to right way when you close some tab... I think that is a bug, or something like this...

    Anybody know some trick to solve this?
    Attached Images

  3. #3
    Ext User karacutey's Avatar
    Join Date
    Nov 2008
    Posts
    46
    Vote Rating
    0
    karacutey is on a distinguished road

      0  

    Default


    yeah thats a bug i dont know if its tracked yet, but that happens to me, i found a work around by calling the .layout() method, and actually have the tab panel rebuild its self from a static copy in memory.

    kinda annoying and un elegant, i think the tab system needs a decent overhaul. the animations also screw up frequently

    kara

  4. #4
    Ext User fulvius's Avatar
    Join Date
    Nov 2007
    Posts
    20
    Vote Rating
    0
    fulvius is on a distinguished road

      0  

    Thumbs up ops... I found the solution

    ops... I found the solution




    note: The key point is the use of FitLayout...


    Code:
    
    	public void onModuleLoad() {
    		Viewport viewport = new Viewport();
    		RootPanel.get().add(viewport);
    		TabPanel tabPanel = new TabPanel();
    		viewport.setLayout(new FitLayout());
    
    		for (int i = 1; i <= 30; i++) {
    			TabItem tabItem = new TabItem("<center>Tab "+ i + " </center>");
    			tabItem.addText(generateDummyText());
    			tabPanel.add(tabItem);
    			tabItem.setClosable(true);
    			tabItem.setScrollMode(Scroll.AUTO);
    			//tabItem.setLayout(new )
    			
    		}
    
    		tabPanel.setAnimScroll(true);
    		tabPanel.setAutoWidth(true);
    		tabPanel.setWidth("100%");
    		tabPanel.setHeight("100%");
    		tabPanel.setTabScroll(true);
    		tabPanel.setMinTabWidth(115);  
    		tabPanel.setResizeTabs(true);  
    		tabPanel.setAutoHeight(true);
    		tabPanel.setScrollIncrement(300);
    		tabPanel.setScrollDuration(50);
    		
    		       
    
    		viewport.add(tabPanel);
    		
    		
    
    	}
    
    	
    	
    	
    	
    	private String generateDummyText() {
    		int r = (int) (Math.random()* 10);
    		String result = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, " +
    				"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. " +
    				"Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris " +
    				"nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in " +
    				"reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla " +
    				"pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa " +
    				"qui officia deserunt mollit anim id est laborum. ";
    		for(int i=0; i < r; i++){
    			result += result;
    		}
    		return result;
    	}

  5. #5
    Ext User
    Join Date
    Oct 2008
    Location
    Warsaw(PL)/Cottbus(GER)
    Posts
    215
    Vote Rating
    0
    EagleEye666666 is on a distinguished road

      0  

    Default


    Quote Originally Posted by fulvius View Post

    note: The key point is the use of FitLayout...
    hehe exactly thats why there is such layout good that u have found it out by urself

  6. #6
    Ext User karacutey's Avatar
    Join Date
    Nov 2008
    Posts
    46
    Vote Rating
    0
    karacutey is on a distinguished road

      0  

    Default


    basically what i found was happening is that when i set the resize tabs to true it was not sizing the tab widths logically, it was doing it based on absolute widths, i assumed would never make the min width smaller then the tab text

  7. #7
    Sencha User
    Join Date
    Nov 2011
    Posts
    1
    Vote Rating
    0
    Kenn123 is on a distinguished road

      0  

    Default


    Hi,

    I'm was trying to implement the tab functionality in GXT (2.2.4). Th same example which you have mentioned above, works fine in FF but in IE the tabs doesn't show up. I'm attaching the screenshot (the circled part are the tabs which looks like small dots). Can any you please help me out how to resolve it.

    Thanks,
    Kenn.

    Tabs.jpg

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar