auroraeosrose
28 Jun 2007, 5:46 AM
I have a paging grid which works perfectly with 1.0.1a and with the 1.1 beta when using the jquery adapater, however jquery is giving me issues in IE7 (yes I have to use that stupid browser) so I'd like to move to a different adapter - however when I do this the paging portion of the grid suddenly no longer works in any browser (tried it with both the yui adapter and the ext-base version)
Using firebug I can see that the get params are NOT being passed at all for the xhr request, so I get every record from the database instead of a paged record (there are no $_GET variables to mess with so my server side script doesn't do the paging) - tried changing the method to post and still no parameters passed. The grid itself works fine, I'm just not getting any paging.
Did something change between 1.0.1a and the 1.1 beta that I'm missing? Or is every adapter but jquery just broken in the beta?
var MYSPACE = MYSPACE || {};
MYSPACE.grid = function()
{
// datastore
var datastore, columnmodel, grid, paging;
// public methods
return {
// constructor
init: function()
{
datastore = new Ext.data.Store({
proxy: new Ext.data.HttpProxy(new Ext.data.Connection({
url: '/list/data',
method: 'get'
})),
reader: new Ext.data.JsonReader({
root: 'list',
totalProperty: 'total',
id: 'id'
},
[
{name: 'first_name', mapping: 'first_name'},
{name: 'id', mapping: 'id'},
{name: 'last_name', mapping: 'last_name'}
]),
enableColumnMove: true,
trackMouseOver: true
});
datastore.baseParams = { view: 'list'};
datastore.setDefaultSort('last_name', 'asc');
columnmodel = new Ext.grid.ColumnModel([
{
header: "Last Name",
dataIndex: 'last_name'
},{
header: "First Name",
dataIndex: 'first_name'
}]);
columnmodel.defaultSortable = true;
grid = new Ext.grid.Grid('people-list', {
ds: datastore,
cm: columnmodel,
loadMask : true,
selModel: new Ext.grid.RowSelectionModel({singleSelect:true}),
enableColLock: false,
autoSizeColumns: true,
monitorWindowResize: true
});
var panel = new Ext.GridPanel(grid,{fitToFrame: true});
var center = MYSPACE.layout.page().getRegion('center');
center.getTabs().stripWrap.setDisplayed(false);
MYSPACE.layout.page().add('center', panel);
grid.render();
var gridFoot = grid.getView().getFooterPanel(true);
paging = new Ext.PagingToolbar(gridFoot, datastore, {
pageSize: 10,
displayInfo: true,
displayMsg: 'Displaying results {0} - {1} of {2}',
emptyMsg: "No results to display"
});
datastore.load({params:{start:0, limit:10}});
}
}
}();
// initialize the application
Ext.onReady(MYSPACE.grid.init, MYSPACE.grid, true);
pro
Using firebug I can see that the get params are NOT being passed at all for the xhr request, so I get every record from the database instead of a paged record (there are no $_GET variables to mess with so my server side script doesn't do the paging) - tried changing the method to post and still no parameters passed. The grid itself works fine, I'm just not getting any paging.
Did something change between 1.0.1a and the 1.1 beta that I'm missing? Or is every adapter but jquery just broken in the beta?
var MYSPACE = MYSPACE || {};
MYSPACE.grid = function()
{
// datastore
var datastore, columnmodel, grid, paging;
// public methods
return {
// constructor
init: function()
{
datastore = new Ext.data.Store({
proxy: new Ext.data.HttpProxy(new Ext.data.Connection({
url: '/list/data',
method: 'get'
})),
reader: new Ext.data.JsonReader({
root: 'list',
totalProperty: 'total',
id: 'id'
},
[
{name: 'first_name', mapping: 'first_name'},
{name: 'id', mapping: 'id'},
{name: 'last_name', mapping: 'last_name'}
]),
enableColumnMove: true,
trackMouseOver: true
});
datastore.baseParams = { view: 'list'};
datastore.setDefaultSort('last_name', 'asc');
columnmodel = new Ext.grid.ColumnModel([
{
header: "Last Name",
dataIndex: 'last_name'
},{
header: "First Name",
dataIndex: 'first_name'
}]);
columnmodel.defaultSortable = true;
grid = new Ext.grid.Grid('people-list', {
ds: datastore,
cm: columnmodel,
loadMask : true,
selModel: new Ext.grid.RowSelectionModel({singleSelect:true}),
enableColLock: false,
autoSizeColumns: true,
monitorWindowResize: true
});
var panel = new Ext.GridPanel(grid,{fitToFrame: true});
var center = MYSPACE.layout.page().getRegion('center');
center.getTabs().stripWrap.setDisplayed(false);
MYSPACE.layout.page().add('center', panel);
grid.render();
var gridFoot = grid.getView().getFooterPanel(true);
paging = new Ext.PagingToolbar(gridFoot, datastore, {
pageSize: 10,
displayInfo: true,
displayMsg: 'Displaying results {0} - {1} of {2}',
emptyMsg: "No results to display"
});
datastore.load({params:{start:0, limit:10}});
}
}
}();
// initialize the application
Ext.onReady(MYSPACE.grid.init, MYSPACE.grid, true);
pro