I'm really hoping someone can spare a few moments to help me. I have no idea why this is no longer working as I swear it was before but now no matter what I try I'm encountering this issue.
I've got a Spring MVC app with Dojo as the front end. Everything was working pretty decently. In a a few places I'm displaying DataGrids that are getting their data from the app using JSON. The problem occurs when there is a lot of data in the tables (say for example 67 records). When I scroll down and the scrollbar hits the point where Dojo loads the next set, instead of doing that I'm getting a repeat of the current data.
So, initially rows 1-25 are displayed, then when I hit the scroll/reload point, it displays rows 1-25 again. It's displaying the correct number of rows, so 67, but it just repeats the data. The same problem is occurring if I use an EnhancedGrid with the pagination plugin. When I click the link for the second page, it just displays the same rows from the first page again, and so on for the third page. Though on the third page there will only be 17 rows so give the correct total of 67 rows.
I'm sure I must be screwing something up because I swear that at least the pagination part of the EnhancedGrid was working before but I have no idea why it would have stopped. Here is how I'm using the grids:
<script type="text/javascript">
reportStore = new dojo.store.JsonRest({target:"/Condor/reports/data"});
reportGrid = new dojox.grid.EnhancedGrid({
store: dataStore = dojo.data.ObjectStore({objectStore: reportStore}),
structure: [
{type: "dojox.grid._CheckBoxSelector"},[
{name:"Legal Authorization", field:"legalAuth", width: "200px"},
{name:"Program Name", field:"programName", width: "200px"},
{name:"Start Date", field:"startDate", width: "100px", formatter: formatDate,
constraint: {formatLength: 'long', selector: "date", datePattern: "MMM d, y"}},
{name:"End Date", field:"endDate", width: "100px", formatter: formatDate,
constraint: {formatLength: 'long', selector: "date", datePattern: "MMM d, y"}},
{name:"Username", field:"username", width: "80px"},
{name:"Active", field:"enabled", width: "50px"},
{name:"IP(s)", field:"targetIP", width: "200px"},
{name:"Matched", field:"matched", width: "100px"}
]],
plugins:{pagination: true}
}, "report-node-id"); // make sure you have a target HTML element with this id
reportGrid.startup();
</script>
That's basically it. What's really weird is that if I make the browser window smaller in height so that the scrollbar is forced to scroll more, then this problem goes away and the proper data is loaded when dojo calls the next set of data. I'm sure that's a big indication of the problem but I can't seem to figure out how to make this work like it is supposed to. Anyone with any thoughts?
View this message in context:
DataGrid and EnhancedGrid not paging JSON data properly.
Sent from the
Dojo Toolkit mailing list archive at Nabble.com.