function r_pmb() {
// define a custom summary function
var ds_thnakademik2 = store_thnakademik2();
var ds_jadwalpmb_persemester = store_jadwalpmb_persemester();
var rd_rekpmb = new Ext.data.JsonReader({
root: 'data',
totalProperty: 'total',
fields: [
{
name: "nmfakultas",
mapping: "nmfakultas"
},
{
name: "nmprodi",
mapping: "nmprodi"
},
{
name: "jmlpendaftar",
mapping: "jmlpendaftar"
},
{
name: "jmlpendaftarhariini",
mapping: "jmlpendaftarhariini"
},
{
name: "jmlpendaftarsampaihariini",
mapping: "jmlpendaftarsampaihariini"
},
{
name: "terverifikasi",
mapping: "terverifikasi"
},
{
name: "diterima",
mapping: "diterima"
},
{
name: "regular",
mapping: "regular"
},
{
name: "nonregular",
mapping: "nonregular"
},
{
name: "registrasi",
mapping: "registrasi"
}
]
});
var ds_grid = new Ext.data.GroupingStore({
reader: rd_rekpmb,
proxy: new Ext.data.HttpProxy({
url: BASE_URL + 'laporan/c_rpmb/grid',
method: 'POST'
}),
baseParams:{idjadwalpmb:'-'},
id:'prodiid',
remoteSort: true,
autoLoad:false,
sortInfo: {field: 'nmfakultas', direction: 'ASC'},
groupField: 'nmfakultas',
listeners: {
load: function(store, records, options) {
var jmlpendaftar = 0
,jmlpendaftarhariini = 0
,jmlpendaftarsampaihariini = 0
,terverifikasi = 0
,diterima = 0
,regular = 0
,nonregular = 0
,registrasi = 0;
ds_grid.each(function (rec) {
jmlpendaftar += parseFloat(rec.get('jmlpendaftar'));
jmlpendaftarhariini += parseFloat(rec.get('jmlpendaftarhariini'));
jmlpendaftarsampaihariini += parseFloat(rec.get('jmlpendaftarsampaihariini'));
terverifikasi += parseFloat(rec.get('terverifikasi'));
diterima += parseFloat(rec.get('diterima'));
regular += parseFloat(rec.get('regular'));
nonregular += parseFloat(rec.get('nonregular'));
registrasi += parseFloat(rec.get('registrasi'));
});
Ext.getCmp('jmlpendaftar').setValue(jmlpendaftar);
Ext.getCmp('jmlpendaftarhariini').setValue(jmlpendaftarhariini);
Ext.getCmp('jmlpendaftarsampaihariini').setValue(jmlpendaftarsampaihariini);
Ext.getCmp('terverifikasi').setValue(terverifikasi);
Ext.getCmp('diterima').setValue(diterima);
Ext.getCmp('regular').setValue(regular);
Ext.getCmp('nonregular').setValue(nonregular);
Ext.getCmp('registrasi').setValue(registrasi);
}
}
});
var cm = new Ext.grid.ColumnModel({
// specify any defaults for each column
defaults: {
sortable: true // columns are not sortable by default
},
columns: [new Ext.grid.RowNumberer(),
{
header: 'Fakultas',
width: 100,
dataIndex: 'nmfakultas',
sortable: true,
},
{
header: 'Program Studi',
width: 100,
dataIndex: 'nmprodi',
sortable: true,
},
{
header: 'Jumlah Pendaftar',
width: 120,
dataIndex: 'jmlpendaftar',
sortable: true,
align:'center'
},
{
header: 'Jumlah Pendaftar Hari Ini',
width: 150,
dataIndex: 'jmlpendaftarhariini',
sortable: true,
align:'center'
},
{
header: 'Jumlah Pendaftar Sampai Hari Ini',
width: 200,
dataIndex: 'jmlpendaftarsampaihariini',
sortable: true,
align:'center'
},
{
header: 'Pendaftar Terverifikasi',
width: 150,
dataIndex: 'terverifikasi',
sortable: true, hidden: true,
align:'center'
},
{
header: 'Diterima',
width: 70,
dataIndex: 'diterima',
sortable: true,
align:'center'
},
{
header: 'Registrasi',
width: 100,
dataIndex: 'registrasi',
sortable: true,
align:'center'
},
{
header: 'Registrasi
(Regular)',
width: 100,
dataIndex: 'regular',
sortable: true,
align:'center'
},
{
header: 'Registrasi
(Non Regular)',
width: 100,
dataIndex: 'nonregular',
sortable: true,
align:'center'
}]
});
var vw = new Ext.grid.GroupingView({
forceFit: true,
showGroupName: false,
enableNoGroups: false,
enableGroupingMenu: false,
hideGroupedColumn: true
});
var sm_nya = new Ext.grid.CheckboxSelectionModel({
listeners: {
}
});
var cari_data = [new Ext.ux.grid.Search({
iconCls: 'btn_search',
minChars: 1,
autoFocus: true,
autoHeight: true,
position: 'top',
mode: 'remote',
width: 200
})];
var grid_nya = new Ext.grid.EditorGridPanel({
store: ds_grid,
frame: true,
height: 530,
id: 'grid_det',
buttonAlign: 'left',
defaults: {
anchor: '-10'
},
loadMask: true,
forceFit: true,
tbar: [{
xtype: 'buttongroup',
title: 'Pencarian',
columns: 4,
width: 800,
defaults: {
scale: 'small'
},
items: [{
text: 'Tahun Akademik - Semester :'
},
{
xtype: 'combo',
store: ds_thnakademik2,
name: 'thnakademik',
id: 'thnakademik',
triggerAction: 'all',
editable: false,
valueField: 'kdstsemester',
displayField: 'nmthnakademik',
forceSelection: true,
submitValue: true,
hiddenName: 'h_thnkademik',
listeners: {},
typeAhead: true,
mode: 'local',
emptyText: 'Pilih...',
selectOnFocus: true,
width: 125,
listeners:{
select: function(cb, rec) {
Ext.getCmp('kdjadwalpmb').disable();
ds_jadwalpmb_persemester.reload({
params: {
kdstsemester: cb.getValue(),
},
callback: function(results){
Ext.getCmp('kdjadwalpmb').enable();
Ext.getCmp('kdjadwalpmb').setValue('-');
}
});
}
}
},{
text: 'Jadwal PMB :'
},
{
xtype: 'combo',
store: ds_jadwalpmb_persemester,
name: 'kdjadwalpmb',
id: 'kdjadwalpmb',
triggerAction: 'all',
editable: false,
valueField: 'idjadwalpmb',
displayField: 'nmjadwalpmb',
forceSelection: true,
submitValue: true,
hiddenName: 'h_kdjadwalpmb',
listeners: {},
typeAhead: true,
disabled: true,
mode: 'local',
emptyText: 'Pilih...',
selectOnFocus: true,
width: 300
}]
},
{
xtype: 'button',
text: ' Cari ',
iconCls: 'silk-find',
id: 'btn_data',
width: 3,
handler: function() {
ds_grid.setBaseParam('kdstsemester', Ext.getCmp('thnakademik').getValue());
ds_grid.setBaseParam('idjadwalpmb', Ext.getCmp('kdjadwalpmb').getValue());
ds_grid.load();
}
},'-',
{
xtype: 'button',
text: ' Cetak ',
iconCls: 'silk-printer',
id: 'btn_cetak',
width: 3,
handler: function() {
var parsing = '';
parsing = parsing + Ext.getCmp('thnakademik').getValue() + 'istra';
parsing = parsing + Ext.getCmp('kdjadwalpmb').getValue();
var win = window.open();
win.location.reload();
win.location = BASE_URL + 'print/print_topdf/plrpmb/'+parsing;
}
}],
sm: sm_nya,
vw: vw,
autoScroll: true,
cm: cm,
bbar:[{
xtype: 'label',
text : "Jml Pndftr:",
style: 'margin-left:10px;margin-right:10px;'
},{
xtype: 'numericfield', width: 50,
id:'jmlpendaftar', readOnly: true,
decimalSeparator: ',', decimalPrecision: 0,
alwaysDisplayDecimals: true,
useThousandSeparator: true, thousandSeparator: '.',
},{
xtype: 'label',
text : "Jml Pndftr Hari Ini:",
style: 'margin-left:10px;margin-right:10px;'
},{
xtype: 'numericfield', width: 50,
id:'jmlpendaftarhariini', readOnly: true,
decimalSeparator: ',', decimalPrecision: 0,
alwaysDisplayDecimals: true,
useThousandSeparator: true, thousandSeparator: '.',
},{
xtype: 'label',
text : "Jml Pndftr s/d Hari Ini:",
style: 'margin-left:10px;margin-right:10px;'
},{
xtype: 'numericfield', width: 50,
id:'jmlpendaftarsampaihariini', readOnly: true,
decimalSeparator: ',', decimalPrecision: 0,
alwaysDisplayDecimals: true,
useThousandSeparator: true, thousandSeparator: '.',
},{
xtype: 'label', hidden: true,
text : "Pndftr Terverifikasi:",
style: 'margin-left:10px;margin-right:10px;'
},{
xtype: 'numericfield', width: 50, hidden: true,
id:'terverifikasi', readOnly: true,
decimalSeparator: ',', decimalPrecision: 0,
alwaysDisplayDecimals: true,
useThousandSeparator: true, thousandSeparator: '.',
},{
xtype: 'label',
text : "Diterima:",
style: 'margin-left:10px;margin-right:10px;'
},{
xtype: 'numericfield', width: 50,
id:'diterima', readOnly: true,
decimalSeparator: ',', decimalPrecision: 0,
alwaysDisplayDecimals: true,
useThousandSeparator: true, thousandSeparator: '.',
},{
xtype: 'label',
text : "Registrasi:",
style: 'margin-left:10px;margin-right:10px;'
},{
xtype: 'numericfield', width: 50,
id:'registrasi', readOnly: true,
decimalSeparator: ',', decimalPrecision: 0,
alwaysDisplayDecimals: true,
useThousandSeparator: true, thousandSeparator: '.',
},{
xtype: 'label',
text : "Registrasi (Regular):",
style: 'margin-left:10px;margin-right:10px;'
},{
xtype: 'numericfield', width: 50,
id:'regular', readOnly: true,
decimalSeparator: ',', decimalPrecision: 0,
alwaysDisplayDecimals: true,
useThousandSeparator: true, thousandSeparator: '.',
},{
xtype: 'label',
text : "Registrasi (Non Regular):",
style: 'margin-left:10px;margin-right:10px;'
},{
xtype: 'numericfield', width: 50,
id:'nonregular', readOnly: true,
decimalSeparator: ',', decimalPrecision: 0,
alwaysDisplayDecimals: true,
useThousandSeparator: true, thousandSeparator: '.',
}],
clicksToEdit: 1,
listeners: {
rowclick: function rowclick(grid, rowIdx) {
var rec = ds_grid.getAt(rowIdx);
nopmbx = rec.data["nopmb"];
}
}
});
var form_bp_general = new Ext.form.FormPanel({
id: 'form_bp_general_id',
title: 'Rekapitulasi Penerimaan Mahasiswa Baru',
region: 'center',
buttonAlign: 'left',
bodyStyle: 'padding: 5px',
border: false,
disabled: true,
waitMsg: 'Waiting...',
maskDisabled: false,
monitorValid: true,
items: [{
layout: 'form',
border: false,
items: [grid_nya]
}]
});
get_content(form_bp_general);
// =============================================================================
}