I tried to build a paged EditorGrid and took the examples for a start.
However I used the Prototype adapter instead of the YUI one.
I also used the HttpProxy store to receive data from the server.
The problem is, that the POST request to the server contains to parameters, which is why paging will never work. extjs - javaeyeæŠ æœ¯ç½‘ç«™:: Also does not work (children aren't even created): .. Dynafaces for JSF) so I am actually psyched to get that 3rd adapter and cut down my page loads. http://extjs2.javaeye.com/?page=2&show_full=trueHOME |
Just by switching back to the YUI adapter everything now is working fine.
But still, something seems to be defect here.
I have the same problem. The pagingtoolbar displays the correct data. But the grid loads the complete datastore and not the number defined at the Pagesize parameter. I think that if you take the paging example from Jack and change de proxy into a Httpproxy the paging doesnt work anymore to. But in the comments frmo Jack it says the httpproxy is better in the example if the php file is on the same server. IComeFromTheNet.net | It's All About the Stuff:: I had a very happy Christmas and new year but now its back to work and learning. The Json stream is loaded at page start with the data filtered on the client side FileUpload control; DB Bound combo Box; Json Store and Http Proxy. prototypes to build custom ajax calls using the jquery methods and not the http://www.icomefromthenet.net/blog/HOME | CSP: A Novel System Architecture for Scalable Internet and :: File Format: PDF/Adobe Acrobat - ViewArchitecture over Ethernet does not provide the same . Furthermore, our prototype has to work under the restrictions imposed by legacy applications http://www.usenix.org/event/usits01/full_papers/shah/shah.pdfHOME |
Hello Jack,
Here is the code that creates my grid.
var GridUI = function() {
var ds; //hold our data
var grid; //component
var columnModel; // definition of the columns
function setupDataSource() {
ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:/get_dealers.php'}),
reader: new Ext.data.JsonReader(
{root: 'records',totalProperty: '281', id: 'sleutel'},
[
{name: 'sleutel'},
{name: 'dealernr'},
{name: 'DA'},
{name: 'rayon'},
{name: 'b_naam'},
{name: 'b_adres'},
{name: 'b_postcode'}
]
)
}
);
}
function getColumnModel() {
if(!columnModel) {
columnModel = new Ext.grid.ColumnModel(
[{
header: "Dealer nr",
dataIndex: 'dealernr',
sortable: true,
width: 40
},{
header: "DA",
sortable: true,
dataIndex: 'DA',
width: 20 To contact the AIX Support Center, call either or 9-1-800-225-5249 :: I've also tried the install via ethernet. Same failure. message is that it's probably caused by the user interrupting the page 4/23/99 We spent the day trying to get the new SCSI adapter working, without success. .. on TCP port 8080. o 204.146.135.162: [low] HTTP-Proxy is active on TCP port 80. http://rick.jasperfamily.org/aix/old.aix.support.center.historyHOME |
},{
header: "Rayon",
sortable: true,
dataIndex: 'rayon',
width: 20
},{
header: "Naam bedrijf",
sortable: true,
dataIndex: 'b_naam',
width: 150
},{
header: "Adres bedrijf",
sortable: true,
dataIndex: 'b_adres',
width: 150
},{
header: "Postcode bedrijf",
sortable: true,
dataIndex: 'b_postcode',
width: 150
}]
);
}
return columnModel;
}
function buildGrid() {
var grid = new Ext.grid.Grid(
'topic-grid',
{
ds: ds,
cm: getColumnModel(),
autoSizeColumns: false,
loadMask: true
}
);
innerLayout.add('center', new Ext.GridPanel(grid, {title: 'Dealers',autoScroll:false}));
grid.on("rowdblclick", function(grid) {
alert(grid.getSelectionModel().getSelected().data. b_naam);
});
grid.render();
var gridFoot = grid.getView().getFooterPanel(true);
var paging = new Ext.PagingToolbar(gridFoot, ds, {
pageSize: 25,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display"
});
ds.load({params:{start:0,limit:25}});
}
return {
init : function() {
setupDataSource();
buildGrid();
}
}
}();
Ext.onReady(GridUI.init, GridUI, true);
Here is a part of the result from my php file. It gives json output:
{"records":[{"sleutel":"1","dealernr":"107800","DA":"D","rayon":"1","b_naam":"NEFKENS UTRECHT BV","b_adres":"ATOOMWEG 79","b_postcode":"3542AA"},{"sleutel":"2","dealernr":"107801","DA":"SV","rayon":"0","b_naam":"NEFKENS UTRECHT BV","b_adres":"ST. LAURENSDREEF 26","b_postcode":"3565AK"},{"sleutel":"3","dealernr":"107803","DA":"SV","rayon":"0","b_naam":"NEFKENS NIEUWEGEIN BV","b_adres":"AMBACHTSWEG 6","b_postcode":"3433PR"}]}
The result off this is a nice grid (i like ext).
My problem:
The grid displays all the 281 records from the datastore. The pagingtoolbar displays the correct data. It says page 1 of 12 ect. In the attachment screenshot from pagingtoolbar. I am new to ext, i hope i didnt make a mistake in my part off the code. Thank you for looking at my problem.
Thank you for your reply. I solved the problem. I was thinking that the 'start' and 'limit' param from the datastore.load always had the same value start:0 and limit:25. I didnt understand that the ext was changing the values when i clicked on the next page button in the pagingtoolbar. Thank you for your time.
Here's part of your prob:
{root: 'records',totalProperty: '281', id: 'sleutel'},
What, you know there will always be 281 records?!
http://www.extjs.com/deploy/ext/docs/output/Ext.data.JsonReader.html#config-totalProperty
The reason why it gets the paging toolbar right is that your PHP script is ignoring the start and limit parameters and sending all 281 records out in one go.
In the absence of a valid totalProperty indicator, the Store uses the number of Records returned as its size. That is 281. But it also knows that you set the limit at 25, and so thinks there are more pages.
I'm having the same issue. Can't get paging to work.
The paging params to the server when you click the next page button only sends the start and limit and not the rest of the params.
Can you post some code. Thanks.
Nortel Unveils Vision, Strategy for Israeli High-Performance Net
Busy Friday Leads to Strong Close for Net Stocks
|