1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| var grid = new Ext.grid.GridPanel({
store: pstore,
cm: columnM,
view: new Ext.grid.GroupingView({
forceFit:true,
groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
}),
frame:true,
width: 1015,
height: 650,
collapsible: true,
animCollapse: false,
loadMask: true,
iconCls: 'icon-grid',
id: 'myGrid',
tbar: new Ext.PagingToolbar({
pageSize: 100,
store: pstore,
displayInfo: true,
displayMsg: 'Displaying customers {0} - {1} of {2}',
emptyMsg: "No customers to display",
items:[
'-',
{
pressed: true,
enableToggle:true,
text: 'Excel Export',
cls: 'x-btn-text-icon details',
handler: function() {
selectedRows = grid.getSelectionModel().getSelections();
rowCount = grid.getSelectionModel().getCount();
var ids = new Array();
if(rowCount == 0) {
Ext.Msg.alert('Alert', 'Cannot export an empty selection');
}
else
{
for(var index=0; index<rowCount; index++) {
var id=selectedRows[index].id;
ids[index]=id;
}
<!--eForm.ids.value=ids;-->
document.excelForm.submit();
}
}
}]
})
}); |
Partager