View Full Version : Grid paging with JSON

14 Nov 2006, 3:51 PM
I'm having some trouble getting the grid to render now that I switch to the JSON data model from XML and adding paging. Everything was working with XML, but I thought I would see if JSON would speed things up, along with paging. Well now the grid doesn't render, and the little "refresh" button on the toolbar just spins and spins. What am I missing? The bulk of my code is below...

//Set up remote data format
var urlSchema = {
root: 'CDRLs',
totalProperty: 'TotalCount',
id: 'use-index',
urlDM = new YAHOO.ext.grid.JSONDataModel(urlSchema);
// initialize paging
urlDM.initPaging('cdrl_json.cfm', 10);
urlDM.setDefaultSort(urlCM, 1, 'ASC');
urlSM = new YAHOO.ext.grid.SingleSelectionModel();

urlGrid = new YAHOO.ext.grid.Grid('results', urlDM, urlCM);


//Attach a double-click listener to the grid
urlGrid.on('rowdblclick', this.showInTab, this, true);