1. #1
    Sencha User
    Join Date
    May 2012
    Location
    Bangalore
    Posts
    95
    Vote Rating
    1
    Rameshlamani is on a distinguished road

      0  

    Default How to reload original store to grid in live-searc once my search text field is empty

    How to reload original store to grid in live-searc once my search text field is empty


    Hi, I have done app using Extjs. I am showing grid records to user, here added feature of livesearch. by entering some text in the field of search field, filtering is happening very nicely based on property name and value. but issue is once i deleted text from search field when search field is becomes empty/blank that time original store data is not populating in the grid. How can i populate original store data to grid once search text field becomes empty? appreciate. thank you

    My code is here:
    incodenewValue is search textfield value i am checking if else part. if newValue null means need to load original store else it will filter store and display the records. i have added below code to reload original store is not working.
    Code:
    {
                    xtype: 'textfield',
                    name: 'searchField',
                    hideLabel: true,
                    width: 200,
                    listeners: {
                        change: {
                            fn: this.onTextFieldChange,
                            scope: this,
                            buffer: 100
                        }
               }
     },
    
     onTextFieldChange: function(field, newValue, oldValue, options){
            if(newValue==''){
                //grid.setStore(store);
                Ext.getCmp('grid').getStore().load();  here grid is id of my Grid
                Ext.getCmp('grid').getView().refresh();
            }
            else {
                grid.store.load().filter([
                    {id: 'name', property: "name", value: newValue, anyMatch: true}
                ]);
            }
        }

  2. #2
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    514
    Vote Rating
    82
    existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice

      1  

    Default


    Have you tried clearing the filters from the store?

  3. #3
    Sencha User
    Join Date
    May 2012
    Location
    Bangalore
    Posts
    95
    Vote Rating
    1
    Rameshlamani is on a distinguished road

      0  

    Default


    Thanks a lot for giving the hints. now i am added grid.store.clearFilter(); to clear the filter once search text field is empty. Working fine. Cheers .

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