Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7974777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:28:25+00:00 2026-06-04T08:28:25+00:00

I’m new in Sencha, I make my first application. I need to put search

  • 0

I’m new in Sencha, I make my first application. I need to put search in the list. I looked through the example search, downloaded from Sencha, but can not figure out how to insert it in the search list. Will be glad to get any hint.
This is my app

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:28:27+00:00Added an answer on June 4, 2026 at 8:28 am

    I struggled with getting the search field to work in an MVC style app at first.

    I was able to make a search field work in your sencha fiddle app like this.

    In your controller I did

    Ext.define('Sencha.controller.Main', {
        extend: 'Ext.app.Controller',
    
        config: {
            refs: {
                main: 'mainpanel'
            },
            control: {
                '#list': {
                    disclose: 'showDetail'
                },
                '#view':{
                    activate:function(){
                        Ext.getCmp('list').add({
                            xtype:'toolbar',
                            docked:'top',
                            items:[{
                                xtype: 'searchfield',
                                itemId:'contact_search',
                                placeHolder: 'Search....',
                                listeners: {
                                    scope: this,
                                    clearicontap: this.onSearchClearIconTap,
                                    keyup: this.onSearchKeyUp}
                            }]
                        })
                            }
                }
            }
        },
    
        showDetail: function(list, record) {
            this.getMain().push({
                xtype: 'recipedetail',
                title: record.fullName(),
                data: record.data
            })
                },  onSearchKeyUp: function(field) {
                    //get the store and the value of the field
                    var value = field.getValue(),
                        store = Ext.getCmp('list').getStore();
    
                    //first clear any current filters on thes tore
                    store.clearFilter();
    
                    //check if a value is set first, as if it isnt we dont have to do anything
                    if (value) {
                        //the user could have entered spaces, so we must split them so we can loop through them all
                        var searches = value.split(' '),
                            regexps = [],
                            i;
    
                        //loop them all
                        for (i = 0; i < searches.length; i++) {
                            //if it is nothing, continue
                            if (!searches[i]) continue;
    
                            //if found, create a new regular expression which is case insenstive
                            regexps.push(new RegExp(searches[i], 'i'));
                        }
    
                        //now filter the store by passing a method
                        //the passed method will be called for each record in the store
                        store.filter(function(record) {
                            var matched = [];
    
                            //loop through each of the regular expressions
                            for (i = 0; i < regexps.length; i++) {
                                var search = regexps[i],
                                    didMatch = record.get('title').match(search);
    
                                //if it matched the first or last name, push it into the matches array
                                matched.push(didMatch);
                            }
    
                            //if nothing was found, return false (dont so in the store)
                            if (regexps.length > 1 && matched.indexOf(false) != -1) {
                                return false;
                            } else {
                                //else true true (show in the store)
                                return matched[0];
                            }
                        });
                    }
                },
    
        /**
    * Called when the user taps on the clear icon in the search field.
    * It simply removes the filter form the store
    */
        onSearchClearIconTap: function() {
            //call the clearFilter method on the store instance
            this.getStore().clearFilter();
        }
    
    });
    

    And then in the app.js I added an ID to the viewport

    launch: function() {
            Ext.Viewport.add({
                id:'view',
                xtype: 'mainpanel'
            });
        }
    

    I also added an ID to the RecieptList.js

        xtype: 'recipelist',
        requires: ['Sencha.store.Recipes'],
        id:'list',
        config: {
    

    Might not be the most conventional solution but it works.
    It is pretty easy to see how it all works together, hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to loop through a bunch of documents I have to put
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I am currently running into a problem where an element is coming back from
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.