Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    56
    Vote Rating
    1
    jwjiwon is on a distinguished road

      0  

    Default [ST2 PR3] Store filterBy error when the store has just one item.

    [ST2 PR3] Store filterBy error when the store has just one item.


    Thanks, Mitchellsimoens,
    Actually the one I wrote down previously was happened in the middle of report THIS bug.

    When I use a filterBy function, it keeps giving me the below message
    Uncaught TypeError: Cannot call method 'addCls' of null
    and I found out that when the list is filtered until the number of list item becomes just one,
    the message show up.

    I use the google Chrome 16, and here's the code I reorganized for you.
    Code:
    Ext.application({
      name: 'Joy',
        
      launch: function(){
        
        var container = Ext.create('Ext.Container', {
            fullscreen: true,
            layout: 'fit',
            items:[
           {
                xtype: 'toolbar',
                dock: 'top',
                title:  'JOY',
                items: [{
                    xtype: 'searchfield',
                    id: 'searchTopicField',
                    placeHolder : 'Topic',
                    border: '1',
                    width: '99%',
                    margin: '5',
                    listeners: {
                            
                      keyup : function( textField, event, options ){
                                    
                        var searchList = container.getComponent('searchTopicList'),
                        textValue = textField.getValue(),
                        searchListStore = searchList.getStore();
                                    
                        console.log(textValue);
                        if(textValue.length > 0){
                    
                          searchList.setHidden(false);
                                
                          var find = false, firstRecord;
                                        
                          searchList.getStore().filterBy(function(record){
                            fieldData = record.data.topic.toLowerCase().indexOf(textValue);
                            if(fieldData > -1){
                                return record;
                            }
                          }); 
                                        
                        }else{
                                        
                            if(searchListStore.isFiltered()){
                                searchListStore.clearFilter(); 
                            } 
                            searchList.setHidden(true);
                        }
                      }
                    }
                }],
                         
                        
              },
              {
                xtype: 'list',
                id: 'searchTopicList',
                flex : 1,
                scrollable : true,
                grouped: true,
                selectedCls: 'x-list-footer-item',
                store: {
                  fields: ['id', 'bigtopic' ,'topic'] ,
                  sorters: 'bigtopic',
                  getGroupString : function(record) {
                      return record.get('bigtopic');
                  }, 
                  data: [
                    {bigtopic: 'Agriculture', topic: 'Agriculture' },
                    {bigtopic: 'Economics', topic: 'Economics'},
                    {bigtopic: 'Education', topic: 'Education economy and society'},
                    {bigtopic: 'Education', topic: 'Higher education and adult learning'},
                    {bigtopic: 'Education', topic: 'Preschool and school'},
                    {bigtopic: 'Education', topic: 'Research and knowledge management'},
                    {bigtopic: 'Employment', topic: 'Employment'},
                    {bigtopic: 'Science', topic: 'Science'}
                  ],
                  proxy: {
                    type: 'localstorage',
                    id: 'id'
                  }    
                },
                itemTpl: "<div class='joy_list'>{topic}</div>"
              }
              ]
            });
        }
    });




  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,731
    Vote Rating
    754
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    I tried this and got not error:

    Code:
    var list  = container.down('list'),
        store = list.getStore();
    
    store.filterBy(function(rec) {
      return /education/i.test(rec.get('bigtopic'));
    });
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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.

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    56
    Vote Rating
    1
    jwjiwon is on a distinguished road

      0  

    Default would you please READ my word?

    would you please READ my word?


    I tried this and got an error:
    which has just one item when it was filtered.

    Code:
    var list = container.down('list'), store = list.getStore();store.filterBy(function(rec) 
    { return /economics/i.test(rec.get('bigtopic'));});

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,731
    Vote Rating
    754
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    And what was the error as I got no errors.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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.

  5. #5
    Sencha User
    Join Date
    Dec 2011
    Posts
    56
    Vote Rating
    1
    jwjiwon is on a distinguished road

      0  

    Default are you sure you tried with economics? not education?

    are you sure you tried with economics? not education?


    untitled.jpg

  6. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,731
    Vote Rating
    754
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Ok, that one is an open bug when there is only one item in the group.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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.

  7. #7
    Sencha User
    Join Date
    Dec 2011
    Posts
    56
    Vote Rating
    1
    jwjiwon is on a distinguished road

      0  

    Default okay no problem.

    okay no problem.


    please make it [OPEN]

  8. #8
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,731
    Vote Rating
    754
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    There is already a bug open. I'm not going to open two for the same thing.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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.

  9. #9
    Sencha User
    Join Date
    Dec 2011
    Posts
    56
    Vote Rating
    1
    jwjiwon is on a distinguished road

      0  

    Default I'm sure you know what I mean :)

    I'm sure you know what I mean :)


    I said it because the title of this thread is still 'closed'.
    Anyway, you said open so it is open

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar