Refresh listgrid

I have two listgrids that I want to refresh once I have completed an update. I have tried using ListGrid4.fetchData() and ListGrid4.filteData(). The actions are not being fired off. When i add criteria filterData or fetchData the data in the grid disappears, but the grid doesn’t reload.

     click: 
        function () {
             
            var rowCount = ListGrid3.getTotalRows();
           
            for (var x = 0; x < rowCount; x++){
            var test = ListGrid3.getEditValue(x,"selection");
                if(test == true){ 
                     var recordRow = ListGrid3.getEditedRecord(x)
                     recordRow.approval = "0"
                     ListGrid3.updateData(recordRow)
                     ListGrid4.fetchData(criteria);
                }
           }
           
    }

Hi Rick,

Take a look at the docs for fetchData() - you can invalidate the cache via invalidateCache(). The records probably disappeared when you added criteria because none of them match the new criteria.

thanks that worked, but now I have a new problem when i do ListGrid3.data.invalidateCache(); and ListGrid4.data.invalidateCache(); the second grid that is executed displays “loading data”. I tried using a redraw() on the second grid but that only caused the first grid to display “loading data”

That sounds like a bug that was fixed in 5.7.1 - grab that release from http://www.smartclient.com/product/download.jsp and let us know if that doesn’t resolve the problem.

Is there a immediate work around for this until we upgrade? I am running into the same problem.

-d

Don’t call invalidateCache() immediately on the second grid, use Timer.setTimeout() to do it after a delay.

Seems to work fine for 2 grids but what about more? Doesn’t seem to work for more than 2 grids.

ah, nevermind. I got it. Thought settimeout was relative to it’s location in code. got it with the right timing.