1. #1
    Sencha User
    Join Date
    Apr 2013
    Posts
    4
    Vote Rating
    0
    pravallika.esarla is on a distinguished road

      0  

    Default Unanswered: extjs Form with a combobox

    Unanswered: extjs Form with a combobox


    Hiii
    Im new to extjs .....i created a combobox which retrieves data from database but now i want to include it in a form with a button .. but totally confused with merging a form and a combobox
    this is my combobox code

    app.js

    Ext.Loader.setConfig({
    enabled: true
    });

    Ext.application({
    name: 'COMBO',
    appFolder: 'app',
    autoCreateViewport: false,

    controllers: [
    'Channels'
    ],
    launch: function() {



    Ext.create('Ext.container.Viewport', {
    standardSubmit: true,
    frame: true,
    items: [
    {
    xtype: 'label',
    text: ' '
    },
    {
    xtype: 'label',
    html: '<b>ExtJs ComboBox with LOCAL query</b>'
    },

    {
    xtype: 'localChannelSearch',
    flex: 1
    },

    });
    }
    });



    LocalChannelSearch.js

    Ext.define('COMBO.view.LocalChannelSearch', {
    extend: 'Ext.form.ComboBox',
    alias: 'widget.localChannelSearch',
    queryMode: 'local',
    displayField: 'name',
    valueField: 'code',
    forceSelection: true,
    id: 'channelSearchBox',
    labelWidth: 150,
    fieldLabel: 'Please select a channel',
    size: 50,
    maxLength: 50,
    allowBlank : false,
    name: 'localChannel',
    store: 'LocalChannels'

    });

  2. #2
    Sencha User
    Join Date
    Feb 2012
    Posts
    4
    Vote Rating
    0
    ChronoT52 is on a distinguished road

      0  

    Default


    Instead of using the viewport to manage your form components, nest them in an Ext.form.Panel.

    Code:
    Ext.create('Ext.container.Viewport', {
       items: [{ 
          xtype: 'form',
          frame: true,
          items: [
             {
                xtype: 'label',
                text: ' '
             }, 
             {
                xtype: 'label',
                html: '<b>ExtJs ComboBox with LOCAL query</b>'
             },
             {
                xtype: 'localChannelSearch',
                flex: 1
             }
          ]
       }]
    });

Thread Participants: 1