1. #1
    Ext User
    Join Date
    May 2010
    Posts
    5
    Vote Rating
    0
    mainmich is on a distinguished road

      0  

    Default How to refresh a gridPanel?

    How to refresh a gridPanel?


    Hi,

    I have a gridPanel that contains data from a database.
    I have a fonction to add data in the database and it work but now i'd like to refresh my gridPanel to see the new data.
    I tried to re-call the function that display the grid but it display the same grid under the first one...

    Romain.

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    Code:
    grid.getStore().reload();

  3. #3
    Ext User
    Join Date
    May 2010
    Posts
    5
    Vote Rating
    0
    mainmich is on a distinguished road

      0  

    Default


    It does not work with my grid, i don't use proxy, i take my data from the data base with java class uning DWR.

    But i found a solution, i put a var gripGlobal as a global var so i can access it anywhere. Then i juste have to hide the gridGlobal and reDisplay it.

    Thank you !

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    That won't reload the data! It hides and shows a DOM element. Completely pointless.

    If you have written your code correctly to use a DWRProxy, then simply grid.getStore().reload() will work.

  5. #5
    Ext User
    Join Date
    Apr 2010
    Posts
    6
    Vote Rating
    0
    vibhakhushi is on a distinguished road

      0  

    Default How to refresh the grid panel if its loaded from a function not using proxy?

    How to refresh the grid panel if its loaded from a function not using proxy?


    Hello Animal.. I'm a newbie in ExtJS. I am loading the grid panel using a function, not using a url. The function gets the data for me from the database. In this case, how to refresh the grid panel?

  6. #6
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    Putting both the code and the data in a single page makes it impossible to do that.

    Rewrite your server app to return the data on a separate url and change the store to load from that page.

    After you having done this you can simply reload() the store.

  7. #7
    Ext User
    Join Date
    Apr 2010
    Posts
    6
    Vote Rating
    0
    vibhakhushi is on a distinguished road

      0  

    Default


    Thank you Condor Your suggestion worked for me

  8. #8
    Sencha User
    Join Date
    Jun 2010
    Posts
    27
    Vote Rating
    0
    solovieff13 is on a distinguished road

      0  

    Exclamation One more question about this:

    One more question about this:


    Hi dudes, I have following stuff:
    Code:
    //process information
        var proc_dataReader = new Ext.data.ArrayReader({}, [{
            name: 'INSERTEDDATE',
                type: 'date',
                dateFormat: 'Y-m-d H:i:s'
        }, {
            name: 'MESSAGEKEY'
        }, {
            name: 'ESBCONTAINER'
        }, {
            name: 'ESBPROCESSNAME'
        }, {
            name: 'ESBPROCESSSTEP'
        }, {
            name: 'LOGLEVEL'
        }]);
        var proc_someData = [
            ["2004-12-01 11:12:13", "Stopped", "Container1", "1231243", "First Step", "DEBUG"],
            ["2004-12-01 11:12:13", "Stopped", "Container1", "1231243", "First Step", "INFO"],
            ["2004-12-01 11:12:13", "Stopped", "Container1", "1231243", "First Step", "ERROR"]
        ];
        var proc_ds = new Ext.data.Store({
            proxy: new Ext.data.PagingMemoryProxy(proc_someData),
            remoteSort: true,
            reader: proc_dataReader
        });
        
        var proc_cm = new Ext.grid.ColumnModel([{
            dataIndex: 'INSERTEDDATE',
            header: 'Date',
            width: 60,
            renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s')
        }, {
            dataIndex: 'MESSAGEKEY',
            width: 50,
            header: 'Status'
        }, {
            dataIndex: 'ESBCONTAINER',
            header: 'Container'
        }, {
            dataIndex: 'ESBPROCESSNAME',
            header: 'Process'
        }, {
            dataIndex: 'ESBPROCESSSTEP',
            header: 'Step'
        }, {
            dataIndex: 'LOGLEVEL',
            header: 'Log Level'
        }]);
        proc_cm.defaultSortable = true;
    
        var proc_grid = new Ext.grid.GridPanel({
            id: 'act_example',
            ds: proc_ds,
            cm: proc_cm,
            height: 200,
            enableColLock: false,
            loadMask: true,
            viewConfig: {
                forceFit: true
            }, plugins: act_filters,
            listeners:{
                activate: function(){
                proc_ds.reload();
                }
            }, 
     
            bbar: new Ext.PagingToolbar({
                store: proc_ds,
                pageSize: 15,
                plugins: act_filters
            })
        });
    
        proc_ds.load({
            params: {
                start: 0,
                limit: 15
            }
        });
    In another place a have a tree, I want to change data in proc_grid likethis:
    Code:
    click: function(n) {
                                                        //Ext.Msg.alert('Navigation Tree Click', 'You clicked: "' + n.attributes.processid + '"');
                                                        proc_someData = [
                                                                         ["2004-12-01 11:12:13", "AAAA", "Container1", "1231243", "First Step", "DEBUG"],
                                                                         ["2004-12-01 11:12:13", "AAAAAAAA", "Container1", "1231243", "First Step", "INFO"],
                                                                         ["2004-12-01 11:12:13", "BBBBBB", "Container1", "1231243", "First Step", "ERROR"]
                                                                     ];
                                                        proc_ds.reload();
                                                        proc_grid.getStore().reload();
                                                    }
    I have an alert on click, but nothing changes, my data is still the same. What am I doing wrong?
    The problem is I can not get the data directly from URL, so I have to do some operations with it to put good objects in my grid.

Similar Threads

  1. Auto Refresh GridPanel?
    By ferryman in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 9 Aug 2009, 10:59 PM
  2. Doubts about GridPanel: sort and refresh
    By Gorka Lopez in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 26 Feb 2009, 11:40 PM
  3. How to refresh GridPanel
    By silcreval in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 29 Dec 2008, 5:11 AM
  4. GridPanel sorting problem after refresh
    By epiceric in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 5 Sep 2008, 2:59 PM
  5. GridPanel won't refresh on GroupingStore reload
    By Luke Hammond in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 12 Jun 2008, 11:15 AM

Thread Participants: 4

Tags for this Thread

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