1. #1
    Sencha User
    Join Date
    Aug 2010
    Posts
    26
    Vote Rating
    0
    sunnyuser is on a distinguished road

      0  

    Default Unanswered: Add widget in right side on ContentPanel

    Unanswered: Add widget in right side on ContentPanel


    HI Guys,

    I want to add child widget (ContentPanel countPanel) in right side on ContentPanel. I tried float attribute but it's not working.

    Any suggestion will help me a lot to do this job.

    ContentPanel panel = new ContentPanel();
    panel.setHeight(24);
    panel.setHeaderVisible(false);
    panel.setBodyBorder(false);
    panel.setBorders(false);
    panel.setLayout(new HBoxLayout());

    TextField<String> searchField = new TextField<String>();
    searchField.setHeight(24);
    searchField.setWidth(75);
    panel.add(searchField);

    Label goButton = new Label("Go");

    panel.add(goButton);

    populateAlphanPanel(panel);

    final ContentPanel countPanel = new ContentPanel();
    countPanel.setHeight(24);
    countPanel.setHeaderVisible(false);
    countPanel.setBodyBorder(false);
    countPanel.setBorders(false);
    countPanel.setLayout(new FitLayout());

    Label countLabel = new Label(getCountStr(0, 0, 0));
    countLabel.setHeight(24);

    countPanel.add(countLabel);
    countPanel.setStyleAttribute("float", "right");

    panel.add(countPanel);
    RootPanel.get().add(panel);

    In this example, I want to add countPanel in the right side of panel.

    with warm regards,

    Sunny.

  2. #2
    Sencha User
    Join Date
    Mar 2011
    Posts
    79
    Vote Rating
    0
    vtysh is on a distinguished road

      0  

    Default


    I see you are using HBoxLayout. Here you can find examples of usage http://www.sencha.com/examples/#hboxlayout
    You can add some flex Text first and then your countPanel to the main panel
    Code:
    HBoxLayoutData flex = new HBoxLayoutData(new Margins(0, 5, 0, 0));  
    flex.setFlex(1);  
    panel.add(new Text(), flex); 
    panel.add(countPanel);
    Also you can use combinations of border layout and some other layout to add necessary panel to the east

  3. #3
    Sencha User
    Join Date
    Aug 2010
    Posts
    26
    Vote Rating
    0
    sunnyuser is on a distinguished road

      0  

    Default Add Widget in right side on ContentPanel

    Add Widget in right side on ContentPanel


    HI,

    I tried BorderLayoutDate but it didn't work for me...

    Please look this code :

    BorderLayoutData borderBorderLayoutData = new BorderLayoutData(LayoutRegion.EAST);
    panel.add(countPanel, borderBorderLayoutData);
    RootPanel.get().add(panel);

  4. #4
    Sencha User
    Join Date
    Mar 2011
    Posts
    79
    Vote Rating
    0
    vtysh is on a distinguished road

      0  

    Default


    Do you have this line?
    Code:
    panel.setLayout(new BorderLayout());

Thread Participants: 1

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