1

I want to refresh a dojo grid in my web page. I tried .refresh which is given in dojotoolkit.org without success. is there any other convenient way to do refreshing? Thanks in advance.

DbxD
  • 540
  • 2
  • 15
  • 29

1 Answers1

2

Maybe this helps. This is the way i refresh my Grid:

if(!registry.byId("GraphGrid")){
        var grid = new EnhancedGrid({
                    id: 'GraphGrid',
                    store: GraphicStore,
                    query: { ident: "*" },
                    structure: layout,
                    rowSelector: '20px',
                    plugins: {
                        indirectSelection: {
                        headerSelector:true, 
                        width:"40px", 
                        styles:"text-align: center;"
                        }}                          
                    },"GridGraphicInMap");

                /*Call startup() to render the grid*/
                grid.startup();

                dojo.connect(grid, "onRowClick", grid, function(evt){
                    var idx = evt.rowIndex,
                        item = this.getItem(idx);

                    //  get a value out of the item
                    var value = this.store.getValue(item, "geom");
                    highlightGeometry(value,true);
                    //  do something with the value.
            });
        }
        else {
          registry.byId("GraphGrid").setStore(GraphicStore);
        }

When i first call my function the grid is generated. Evrytime i call the function later only the store is refreshed.

Regards, Miriam

MiBrock
  • 1,100
  • 1
  • 11
  • 22
  • 1
    The key to refreshing in this code is resetting the store. By the way, the grids in `dojox/grid` are deprecated; if you are starting something new, the replacements are [dgrid](http://dgrid.io) (recommended) or [gridx](https://github.com/oria/gridx). – C Snover Aug 08 '13 at 04:39