Hybrid View

  1. #1
    Sencha User
    Join Date
    Aug 2008
    Posts
    226
    Vote Rating
    2
    TheBuzzer is on a distinguished road

      0  

    Default FormHorizontalPanel

    FormHorizontalPanel


    This is a helper class I made to make stuff in the formlayout and the widgets be placed horizontally. If there is a better way tell me.

    Code:
    package com.ottocap.NewWorkFlow.client.Widget;
    
    import com.extjs.gxt.ui.client.widget.HorizontalPanel;
    import com.extjs.gxt.ui.client.widget.LayoutContainer;
    import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
    import com.extjs.gxt.ui.client.widget.layout.FormData;
    import com.extjs.gxt.ui.client.widget.layout.FormLayout;
    import com.google.gwt.user.client.ui.Widget;
    
    public class FormHorizontalPanel extends HorizontalPanel {
        
        public static FormLayout newFormLayout() {
            FormLayout formlayout = new FormLayout(LabelAlign.TOP);
            return formlayout;
        }
        
        public boolean add(Widget widget) {
            return add(widget,218);
        }
        
        public boolean add(Widget widget,int width) {
            return add(widget,width,width-18);
        }
        
        private boolean add(Widget widget,int width, int widgetwidth) {
            LayoutContainer mylayout = new LayoutContainer(newFormLayout());
            mylayout.add(widget, new FormData(widgetwidth,-1));
            mylayout.setWidth(width);
            return super.add(mylayout);
        }    
    
        public boolean addCheckBox(Widget widget) {
            FormLayout myformlayout = newFormLayout();
            myformlayout.setLabelSeparator("");
            LayoutContainer mylayout = new LayoutContainer(myformlayout);
            mylayout.add(widget);
            mylayout.setWidth(218);
            return super.add(mylayout);
        }        
        
        public boolean addSubmit(Widget widget) {
            LayoutContainer mylayout = new LayoutContainer(newFormLayout());
            mylayout.addStyleName("SideSubmit");
            mylayout.add(widget);
            return super.add(mylayout);
        }
    
    }

  2. #2
    Ext GWT Premium Member
    Join Date
    Mar 2009
    Posts
    91
    Vote Rating
    0
    databass is on a distinguished road

      0  

    Default


    Thanks. This may be useful when I need to start building forms.

    I do hope that future versions have GXT have more robust support for form layout and validation.

    Grids and trees have amazingly rich functionality in GXT, but forms are a bit lacking. The sheer number of third-party add-ons that people have built to make Forms easier in GXT attest to that.

  3. #3
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    0
    Arno.Nyhm is on a distinguished road

      0  

    Default


    this class is not so much generic. for example if i need a different LabelAlign :-(

    one try i like to give the FormLayout in a constructor to this class. but this is also not good, because it sets always the layout so can not reuse the formlayout. i am on a way to erwrite this class a little bit ...


    PS:
    i still looking for a replacement for my gxt-ext multifieldpanel:
    http://extjs.com/forum/showthread.ph...ultifieldpanel


    PS:
    maybe this is also interesting for you:
    http://extjs.com/forum/showthread.ph...t=gxt-jglayout
    This forum needs your help: you got hints from the community and now you have fixed your code? dont just reply with "now its fixed" or "i found the error"! please take the time to post also an detailed answer with the working code.

    GreaseMonkey Script for a GXT-only Forum: it hides ExtJs here: New Posts • Search Results • Advanced Search form • Category overview http://www.extjs.com/forum/showthrea...041#post410041

Thread Participants: 2

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