Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EXTJS4-how to implement search box

Tags:

extjs

extjs4

how to have a search box(or search field) in a EXTJS page.

I tried the following, but nothing is being displayed in the page: 1. added SearchField.js in WebContent/ext/ux folder. 2. coded the following:

    Ext.Loader.setConfig({
            enabled: true,
            paths: {
                'Ext.ux': 'ext/ux'
            }
        });
        Ext.require([
                     'Ext.ux.form.SearchField'
                 ]);
    Ext.onReady(function () {
    var win=Ext.create('widget.window',{
            title: 'Super User Access Management',
            height: 480,
            width: 640,
    border:false,
              items       : [ 
{
          xtype      : 'combobox',
          fieldLabel : 'Module',

          value: 'Super Admin' ,
          store: ['Super Admin', 'Partner Contact Management', 'Partner Trainning Management'],
          listeners: {
              select: function(){
               alert('Hello module!');
              }
            }        
            },
            {
              xtype      : 'combobox',

              value: 'Infogain' ,
              store: ['Infogain', 'IBM', 'Mocrosoft'],
              listeners: {
                    select: function(){
                     alert('Hello partner!');
                    }
                  }        
                },
     {
                        xtype: 'searchfield',
                        height: 30,
                        id: 'searchField',
                        styleHtmlContent: true,
                        width: 320,
                        fieldLabel: '',
                    },
{ 
                  xtype: 'gridpanel',
                  border: false,
                  title:'Empty grid',
                  columns: [{header: 'World'}], 
                  store: Ext.create('Ext.data.ArrayStore', {}) 
                  }
       ]
        });
        win.show();
    });

please let me know where I am doing wrong.

like image 576
Anushree Acharjee Avatar asked Feb 17 '26 08:02

Anushree Acharjee


1 Answers

Answer on the comment under the question:

I use a Ext.toolbar.Toolbar for that purpose.

Like This

You can place the toolbar in a container with the dockedItems config.

like image 153
A1rPun Avatar answered Feb 21 '26 14:02

A1rPun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!