Results 1 to 3 of 3

Thread: Which container to use to subdivide a form with HBox and VBox?

  1. #1
    Sencha User
    Join Date
    Apr 2008
    Posts
    365
    Vote Rating
    0
      0  

    Question Which container to use to subdivide a form with HBox and VBox?

    Hello! I want to make a FormPanel with several rows, in every row there should be some formfields. The form should be flexible in horizontal size (the formfields should resize and fill the whole width of the FormPanel when it's resized), so I guess using VBoxes as rows and inside them HBoxes is the right way to do it (is it??!?)

    My Q: What container should I use to put my rows inside? Ext.panel.Panel, Ext.container.Container or Ext.container.Container any other thing? The container should be invisible, so no special appearance is needed.

  2. #2
    Sencha User
    Join Date
    Jan 2011
    Posts
    11
    Vote Rating
    0
      0  

    Default column layout

    use Ext.panel with column layout.


    example:

    {
    xtype: "panel",
    layout: "column",
    border: false,
    bodyStyle: "padding: 5px 5px 0;",
    items: [{
    columnWidth: .50,
    xtype: 'form',
    border: false,
    width: 370,
    height: 70,
    items: [{
    xtype: 'textfield',
    id: "bidNameTxt",
    fieldLabel: "Bid Name",
    maxLength: 250,
    labelWidth: 75,
    width: 310,
    enableKeyEvents: true,
    listeners:{
    scope: this,
    'keyup': function(src, evt){
    task.delay(500);
    }
    }
    },
    {
    xtype: 'combo',
    id: "cmbFolder",
    labelWidth: 75,
    fieldLabel: "Bid Group",
    store: bidFolderStore,
    forceSelection: true,
    typeAhead: true,
    triggerAction: 'all',
    editable: false,
    queryMode: 'local',
    displayField: 'folder',
    valueField: 'id'
    },
    {
    xtype: "panel",
    border: false,
    header: false,
    height: 20,
    style: "width: 100%;",
    items: {
    id: "messageLbl",
    xtype: "label",
    style: "width: 100%;"
    }
    }]
    },
    {

    columnWidth: .40,
    xtype: "panel",
    id: "bidStatusPnl",
    layout: 'column',
    border: false,
    header: false,
    items:[{
    xtype: 'label',
    id: 'iconLbl',
    cls: "iconStatus",
    border: false,
    html: '<img src="images/active.png" title="Active" class="imgMargin">'
    }, {
    xtype: 'label',
    id: 'statusLbl',
    cls: "bidStatusPnl",
    html: '<span class="activeText">Active</span>'
    },
    {
    xtype: 'button',
    text: "Clone Bid",
    id: "cloneBtn",
    width: 60,
    listeners: {
    "click":function()
    {
    //window.location = Ext.jmc.common.paths.get("AddBid")+ "?BidNameClone="+ escape(Ext.getCmp("bidNameTxt").getValue()) ;
    }
    }
    }]
    }]

  3. #3
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,061
    Vote Rating
    1389
      0  

    Default

    Please wrap code in the appropriate code tags.

    your form.Panel should use Containers to your columns/rows
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •