How can'I change the serverside code to look for the start and limit params which get added to the url automatically on initial rendering?
In my example, instead of displaing only 10 rows, there is all the rows in all the pages (6 pages in my case) of the grid. I want to kwon what is the problem :
var columnModel; <?php if (!defined('MEDIAWIKI')) die(); /** * Implements the core :: $this->paging['start'] + $this->paging['count'] ) { $offset = $this->options[' offset']+$this->options['limit']; $nextious = $this->makeOffsetLink( $nextious http://svn.wikia-code.com/wikia/branches/Bartek/extensions/Translate/TranslatePage.phpHOME |
var tableModelName;
var fieldsArray;
Ext.onReady(function() {
fieldsArray = [
{name : 'utlcod' , mapping : 'utlcod'},
{name : 'utlnom' , mapping : 'utlnom'},
{name : 'utldat' , mapping : 'utldat'},
{name : 'utleml' , mapping : 'utleml'}
];
var store = new Ext.data.Store (
{
proxy: new Ext.data.HttpProxy (
{
url: myUrl
}
),
reader: new Ext.data.XmlReader(
{record: "record" },
fieldsArray
), Paging mechanism using XML+XSLT | WebProNews:: Aug 3, 2004   <xml-doc-name start="1" limit="3">mylist.xml</xml-doc-name> </xml- controller> Solve this simple math problem and enter the result. http://www.webpronews.com/topnews/2004/08/03/paging-mechanism-using-xmlxsltHOME |
// turn on remote sorting
remoteSort: true
});
store.setDefaultSort('ultcod', 'ASC');
// pluggable renders
function renderTopic(value, p, record){
return String.format('{0}{1}', value, record.data['utlcod']);
}
function renderLast(value, p, r){
return String.format('{0} by {1}', value, r.data['utleml']);
}
columnModel = new Ext.grid.ColumnModel([
{
id: 'utlcod',
header: 'Code user',
width: 90,
dataIndex: 'utlcod',
renderer: renderTopic
},
{
header: 'Nom user',
width:90,
dataIndex: 'utlnom'
},
{
header: 'Date',
width: 90,
sortable: true,
dataIndex: 'utldat'
},
{
header: 'email user',
width:90,
dataIndex: 'utleml',
renderer: renderLast
}
]);
function getColumnModel() {
return columnModel;
}
var grid = new Ext.grid.GridPanel({
el:'mygrid',
width:730,
height:300,
title:'View Data',
store: store,
cm: getColumnModel(),
trackMouseOver:false,
loadMask: true,
enableHdMenu: false,
bbar: new Ext.PagingToolbar({
pageSize: 10,
store: store,
displayInfo: true,
displayMsg: 'Displaying rows {0} - {1} of {2}',
emptyMsg: "No data to display"
})
});
grid.render();
grid.getSelectionModel().selectFirstRow();
// trigger the data store load
store.load({params:{start:0, limit:10}});
function toggleDetails(btn, pressed){
var view = grid.getView();
view.showPreview = pressed;
view.refresh();
}
});
What is the problem whith renderTopic() and renderLast() :-/
Hi,
This is the "Examples and Extras" forum section, not the "help" section.
Anyway,
How can'I change the serverside code to look for the start and limit params which get added to the url automatically on initial rendering?
In my example, instead of displaing only 10 rows, there is all the rows in all the pages (6 pages in my case) of the grid. I want to kwon what is the problem
Well this is code on the server side, nothing to do with extjs or javascript.
Just send only the rows asked.
Even with a paging toolbar, if you send more than pageSize rows, it won't slice them. That's your job to slice it server side.
But you should also send a "totalCount" property, for the pagingToolbar to know how many pages there are .
What is the problem whith renderTopic() and renderLast() :-/
Is this a question ?
If yes, well, what is the problem you encounter ?
Red Hat's Rough Recovery From CFO Exit
Windows Live Finds a New, Pre-installed Home
|