Results 1 to 2 of 2

Thread: SearchList example problem

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    14
    Answers
    1
    Vote Rating
    0
      0  

    Default Unanswered: SearchList example problem

    Code:
    Ext.define('MyApp.view.MyPanel', {       extend: 'Ext.Panel',
        xtype:'mypanel',
        
        config: {
            ui: 'dark',
            weight:1024,
            height:800,
            layout: {
                type: 'card'
            },
            items: [
                {
                    xtype: 'titlebar',
                    docked: 'top',
                    title: 'Lezzet Dunyasi',
                    items: [
                        {
                            xtype: 'button',
                            docked: 'right',
                            height: 29,
                            hidden: true,
                            ui: 'back',
                            text: 'back'
                        }
                    ]
                },
                {
                    xtype: 'list',
                    docked: 'left',
                    id: 'mylist',
                    ui: 'round',
    
    
                            pinHeaders: false,
                             grouped: true,
                        disableSelection: true,
                    width: 331,
                    heigth: 2000,
                    itemTpl: [
                        '<img src="{img_url}" width="60" heigh="60"></img><span>{label}</span>'
                    ],
                   store: 'Menius',
    
    
                                 items: [
                                    {
                                        xtype: 'searchfield',
                                        docked: 'top',
                                        placeHolder: 'Arama...',
                                        autoCapitalize: true,
                                        label: 'Anahtar Kelime',
                                        labelWidth: '%60',
    
    
                                      listeners : {
                
                                                        scope: this,
                                            clearicontap: this.onSearchClearIconTap,
                                            keyup: this.onSearchKeyUp
                                                    }
                                        
                                        
                                    
    
    
                             
    
    
                                                              
                          
    
    
            
                                                                                }
                                                                            ]
                                                                        },
    
    
                                                                            onSearchKeyUp:function(field) {
                                                                                var value = field.getValue(),
                                                                                Menius = this.getStore();
                                                                                Menius.ClearFilter();
    
    
                                                                                if (value) {
    
    
                                                                                var searches = value.split(' '),
                                                                                                regexps = [],
                                                                                                i;
    
    
                                                                                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'));
                                                                                        }
    
    
                                                                                        Menius.filter(function(record) {
                                                                                        var matched = [];
    
    
                                                                                        for (i = 0; i < regexps.length; i++) {
                                                                                        var search = regexps[i],
                                                                                            didMatch = record.get('firstName').match(search) || record.get('lastName').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];
                                                                                            }
    
    
                                                                                });
                                                                            }
                                                                                
                                                                            }
                {
                                xtype: 'carousel',
    
    
                                defaults: {
                                    styleHtmlContent:true,
                                     scrollable:true,
                                
                                
                                },
    
    
                                items: [
                                    {
    
    
                                       style: {
                                                                    backgroundImage: 'url(resources/img/Landscape.png)',
                                                                    backgroundRepeat: 'no-repeat',
                                                                    backgroundPosition: 'center'          
                                                },
                                        id:'mypanel1'
    
    
                                    },
                                  
                                    {   
                                        xtype:'video',
                                        autoResume:true,
                                        autoPause:true,
                                        width:'100%',
                                        height:'80%',
                                        align:'center',
                                        
                                        
                                     
                                        url:['resources/video/domates_corbasi.mp4'],
    
    
                                        /*style: {
                                                                   backgroundImage: 'url(resources/img/Landscape.png)',
                                                                    backgroundRepeat: 'no-repeat',
                                                                    backgroundPosition: 'center'         
                                                },*/
                                        
                                        id:'myvideo'
                                    }
                                ]
                            }
            ]
        }
        
    });

    I just wrote same search code for my project but i can't run search , i really looked various ways to handle the problem but i couldn't figure out what's going on.

    I'm looking for help asap thanks.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,323
    Answers
    3884
    Vote Rating
    1294
      0  

    Default

    What is it doing? Any errors, anything happening currently?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread

Posting Permissions

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