PDA

View Full Version : please help me for paging.



baramgil
28 Apr 2011, 2:34 PM
please help me for paging function...:((
If i search row data more than 20.
I can not see alert.
please check to fn_check_data().
Thank you.
=============================================

var store_grid1 = new Ext.ux.data.PagingStore( {
lastOptions: {params: {start: 0, limit: 20}},
reader : new Ext.data.JsonReader( {
root : 'grid_data_list'
}, [ {
name : 'MONTH'
}, {
name : 'MATL_CD'
}
])
});


var pt_grid1 = new Ext.PagingToolbar({
pageSize: 20,
store: store_grid1,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display",
plugins: new Ext.ux.SlidingPager()
});


var grid1 = new Ext.grid.EditorGridPanel({
height : 300,
frame:true,
stripeRows: true,
autoScroll:true,
clicksToEdit : 1,
store : store_grid1,
cm: new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer({header: 'No.', width : 30, align : 'center'}),
{
header : 'Month',
dataIndex : 'MONTH',
width : 50
}, {
header : 'Material Code',
dataIndex : 'MATL_CD',
width : 150
}
]),
bbar: pt_popup1_grid1,
tbar:['->',
{
text : 'Search',
handler : function() {
fn_get_data();
}
},{
text : 'Check Data',
handler : function() {
fn_check_data();
}
}]
});


function fn_get_data(){
Ext.Ajax.request({
url : '/test/DaoExecutorController.do',
method : 'POST',
params : '....',
success : function(result, request) {
try {
var resObj = Ext.decode(result.responseText);

if (resObj.message == null || resObj.message == '') {
grid1.store.loadData(resObj, false);
} else {
alert('Failure Message : ' + resObj.message);
}
} catch(err) {
txt = "There was an error on this page.\n";
txt += "Error description: " + err.description + "\n";
txt += "Click OK to continue.\n";
Ext.Msg.alert('Error Message', txt);
throw err;
}
if(title) Ext.MessageBox.hide();
},
failure : function() {
Ext.Msg.alert('Failure Message', 'Request failed.');
}
});
}


function fn_check_data(){
for(var i = 0; i < grid1.store.getTotalCount(); i++) {
var v_matlCd = grid1.store.getAt(i).get('MATL_CD');
alert(v_matlCd);
.
.
.
}
}