PDA

View Full Version : grid : Paging Toolbar button inactive



yopiyop
18 Oct 2006, 5:14 AM
did i miss something ? click on next/previous button has no effect...

env : mozilla 1.5 , 2 ,IE6 on windows 2000.

here is my test :



<html>
<head>
<script></script>
<script></script>
<script></script>
<script></script>
<script></script>
<script></script>

<script></script>

<link>
<link>
</head>
<body>
<div></div>
<script>
var Example = {
init : function(){
//--------- definition des colonnes----------------------
var myColumns = [ {header: "col1 avec un libellé long", width: 60, editor: new YAHOO.ext.grid.TextEditor() }
,{header: "col-2", width: 820, editor: new YAHOO.ext.grid.TextEditor() }
];
var colModel = new YAHOO.ext.grid.DefaultColumnModel(myColumns);
colModel.defaultSortable = false;
//--------- definition du mode de selction /edition ----------------------
var selModel = new YAHOO.ext.grid.EditorAndSelectionModel();
//--------- definition du model ----------------------
var schema = { root: 'food',
id: 'name',
fields: ['name', 'price']
};
var dataModel = new YAHOO.ext.grid.JSONDataModel(schema);
dataModel.getTotalRowCount = function(){ return 500; }
dataModel.initPaging('server.html', 10 );
dataModel.baseParams = {'myId': 100 };

dataModel.addListener('cellupdated', function(o ,row, col){alert('col-row:'+col+'-'+row);} );
dataModel.addListener('load', selModel.selectFirstRow, selModel, true);
dataModel.addListener('loadexception', function(o,mess, res){alert('exception load:' + mess);} );

//--------- construction grille ---------------------------------------
this.grid = new YAHOO.ext.grid.Grid('grid-example', dataModel, colModel,selModel );
this.grid.render();

dataModel.loadPage(1);
}
}
YAHOO.util.Event.on(window, 'load', Example.init, Example, true);
</script>
</body>
</html>



with server.html response :



({ 'food': [ {'name': '0 banana','price': 9}, {'name': '1 banana','price': 9}, {'name': '2 banana','price': 9}, {'name': '3 banana','price': 9}, {'name': '4 banana','price': 9}, {'name': '5 banana','price': 9}, {'name': '6 banana','price': 9}, {'name': '7 banana','price': 9}, {'name': '8 banana','price': 9}, {'name': '9 banana','price': 9}]})


Cordialement,
David

jack.slocum
18 Oct 2006, 7:25 AM
Download the latest version (0.32.3.1), I uploaded it shortly after 0.32.3 to fix the broken buttons problem.