Results 1 to 4 of 4

Thread: [SOLVED] Problem refreshing the GridPanel

  1. #1
    Sencha User talha06's Avatar
    Join Date
    Jul 2009
    Location
    Turkey
    Posts
    327

    Post [SOLVED] Problem refreshing the GridPanel

    Hello to everyone,

    I'm not an advanced developer at ExtJS. I'm working a library automation system. In my search page when the page opened first time, I show ALL books on grid.. After the user enters the keywords for search I want to refresh the grid.. When user enters keywords and click the button, I connect with DB and return the records.. I change the store's proxy url.. There's no problem at these steps.. Because I checked the returning values(actually they're books in my project).. I can't refresh the grid.. I see ALL records(as I see first).. Nothing changes..

    Here's what I tried.. Actually I searched a lot and saw that many people have same problem.. I did what they recommend, but their recommendations didn't work for me..

    Thanx in advance,
    T

    Here's the code:
    Code:
    handler: function() {
    var m = Ext.getCmp('searchText').getValue();
    var n = Ext.getCmp('byText').getValue();
    Ext.Ajax.request({
    url: 'searchList?searchText='+ m +'&byText=' + n,
    method: 'POST',
    success: function(result, request) {
    // new store proxy url - this one returns the searched books; first one lists ALL books
    Ext.getCmp('grid').getStore().proxy.conn.url = 'searchList?searchText='+ m +'&byText=' + n;  
    Ext.getCmp('grid').getStore().reload();
    }
    })
    }
    
    // I tried these too (which I saw from the forum(s))
    //Ext.getCmp('grid').getStore().load({url:'searchList?searchText='+ m +'&byText=' + n});
    //Ext.getCmp('grid').getStore().reload({url:'searchList?searchText='+ m +'&byText=' + n});
    //Ext.getCmp('grid').getView().refresh(true);
    Last edited by talha06; 1 Dec 2009 at 9:31 AM. Reason: solved

  2. #2
    Sencha User talha06's Avatar
    Join Date
    Jul 2009
    Location
    Turkey
    Posts
    327

    Default

    I need an instant help... please can someone help me??

  3. #3

    Default

    Why do you hard code the URL parameters manually by modifying the URL ?
    Use the params: config parameter of the store and load the store with them.

    Code:
    Ext.getCmp('grid').getStore().load({ params: {searchText: m, byText:n } });
    That should reload the grid.

  4. #4
    Sencha User talha06's Avatar
    Join Date
    Jul 2009
    Location
    Turkey
    Posts
    327

    Default

    thank u so much dear LutzAlbers, it worked finally.. really it appreciated a lot, thanx a lot again for taking time to reply and help..

Posting Permissions

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