BufferedRenderer doesn't work with non-remote data/stores

There is a problem with the BufferedRenderer grid's plugin that prevents it from working with data not loaded with a proxy - or at least that's the best way I can summarize it :P

Anyhow, there are 2 scenarios where this can be seen: 1) you directly add records to a store or 2) the store is created dynamically (e.g.) on a hasMany association. Visually the grid will display just a single item and errors will start appearing on the console and the application starts to become instable/buggy.

I've tracked down the problem to the setViewSize method of the BufferedRenderer plugin on the line:

Code:

end = Math.min(start + viewSize - 1, store.getTotalCount() - 1);

In that line ExtJs is querying the totalCount for the store, however, stores created as I described above, do not have a totalCount set, only a count.

I believe the best solution would be to change that call to something like (store.getTotalCount() || store.getCount()) but I'm unsure of the impact of a larger scale. Anyhow, here's a test case: