function getMhsDPKDPP(){ //===============DPK========================= var ds_nya = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'mahasiswa_controller/DPKMhs', method: 'POST' }), root: 'data', totalProperty: 'results', id: 'dsid', name: 'dsid', remoteSort: true, autoLoad: true, waitMsg: 'Mengunduh..', baseParams: { nim:'-' }, fields: [{ name: "nokuitansi", mapping: "nokuitansi" }, { name: "tglkuitansi", mapping: "tglkuitansi" }, { name: "nmcarabyr", mapping: "nmcarabyr" }, { name: "noref", mapping: "noref" }, { name: "useridinput", mapping: "useridinput" }, { name: "jmlbayar", mapping: "jmlbayar" }], listeners: { load: function(store, records, options) { // Ext.getCmp('jmlsks2').setValue(store.getAt(0)); // alert(store.getAt(0).data['kdmk']); } } }); var sm_nya = new Ext.grid.CheckboxSelectionModel({ listeners: { selectionchange: function(sm) { } } }); var vw = new Ext.grid.GridView({ emptyText: '< No Data To Display >' }); var cm = new Ext.grid.ColumnModel({ // specify any defaults for each column defaults: { sortable: true // columns are not sortable by default }, columns: [//sm_nya, new Ext.grid.RowNumberer(), { header: 'No. Kuitansi', width: 150, dataIndex: 'nokuitansi', sortable: true }, { header: 'Tgl. Kuitansi', width: 120, dataIndex: 'tglkuitansi', sortable: true }, { header: 'Cara Bayar', width: 110, dataIndex: 'nmcarabyr', sortable: true }, { header: 'No. Ref/Bukti Transfer', width: 150, dataIndex: 'noref', sortable: true }, { header: 'Penerima', width: 110, dataIndex: 'useridinput', sortable: true }, { header: 'Jumlah Bayar', width: 120, align:'right', dataIndex: 'jmlbayar', sortable: true, xtype: 'numbercolumn', format:'0,000' }] }); var grid_nya = new Ext.grid.EditorGridPanel({ store: ds_nya, vw: vw, sm: sm_nya, cm: cm, autoScroll: true, columnLines: true, clicksToEdit: 1, loadMask: true, frame: true, height: 150, id: 'grid_det_nya', tbar: [{ xtype: 'textfield', id: 'paramnimdpk', name: 'paramnimdpk', fieldLabel: 'NIM : ', hidden: true, width: 150, validator: function(value){ var a = value; if (a) { ds_nya.setBaseParam('nim', a); ds_nya.load({ scope : this, callback: function(records, operation, success) { var jumlahbayardpk = 0; ds_nya.each(function (rec) { jumlahbayardpk += parseFloat(rec.get('jmlbayar')); }); Ext.getCmp('totdpk').setValue(jumlahbayardpk); } }); } } }], listeners: { rowclick: function rowClick(grid, rowIdx) { // var rec = ds_nya.getAt(rowIdx); // KDMK= rec.data['kdmk']; // NIDU= rec.data['nidu']; } } }); //===============DPP========================= var ds_nya1 = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'mahasiswa_controller/DPPMhs', method: 'POST' }), root: 'data', totalProperty: 'results', id: 'dsid1', name: 'dsid1', //remoteSort: true, autoLoad: true, waitMsg: 'Mengunduh..', baseParams: { nim:'-' }, fields: [{ name: "kdstsemester", mapping: "kdstsemester" }, { name: "thnakademik", mapping: "thnakademik" }, { name: "biaya", mapping: "biaya" }, { name: "diskon", mapping: "diskon" }, { name: "jeniskelas", mapping: "jeniskelas" }, { name: "tagihan", mapping: "tagihan" }, { name: "totbayar", mapping: "totbayar" }, { name: "persen", mapping: "persen" }, { name: "statusbayar", mapping: "statusbayar" }], listeners: { load: function(store, records, options) { } } }); var sm_nya1 = new Ext.grid.CheckboxSelectionModel({ listeners: { selectionchange: function(sm) { } } }); var vw1 = new Ext.grid.GridView({ emptyText: '< No Data To Display >' }); var cm1 = new Ext.grid.ColumnModel({ columns: [//sm_nya, new Ext.grid.RowNumberer(), { header: 'Tahun Akademik - Semester', width: 150, dataIndex: 'thnakademik', sortable: true }, { header: 'Biaya DPP', width: 110, align:'right', dataIndex: 'biaya', sortable: true, xtype: 'numbercolumn', format:'0,000' }, { header: 'Diskon DPP', width: 110, align:'right', dataIndex: 'diskon', sortable: true, xtype: 'numbercolumn', format:'0,000' }, { header: 'Tagihan', width: 100, align:'right', dataIndex: 'tagihan', sortable: true, xtype: 'numbercolumn', format:'0,000' }, { header: 'Total Bayar', width: 110, align:'right', dataIndex: 'totbayar', sortable: true, xtype: 'numbercolumn', format:'0,000' }, { header: 'Persentase', width: 90, align:'right', dataIndex: 'persen', sortable: true }, { header: 'Status Bayar', width: 90, dataIndex: 'statusbayar', sortable: true }] }); var grid_nya1 = new Ext.grid.EditorGridPanel({ store: ds_nya1, vw: vw1, sm: sm_nya1, cm: cm1, autoScroll: true, columnLines: true, clicksToEdit: 1, loadMask: true, frame: true, height: 150, id: 'grid_det_nya', tbar: [{ xtype: 'textfield', id: 'paramnimdpp', name: 'paramnimdpp', fieldLabel: 'NIM : ', hidden: true, width: 150, validator: function(value){ var a = value; if (a) { ds_nya1.setBaseParam('nim', a); ds_nya1.setBaseParam('kdprodi', Ext.getCmp('cb.prodireg').getValue()); ds_nya1.setBaseParam('thmasuk', Ext.getCmp('cb.thmasuk').getValue()); ds_nya1.setBaseParam('idklsmhs', Ext.getCmp('cb.class').getValue()); ds_nya1.load({ scope : this, callback: function(records, operation, success) { } }); } } }, { xtype: 'textfield', id: 'stsmt', name: 'stsmt', fieldLabel: 'NIM : ', hidden: true, width: 150 }, { xtype: 'textfield', id: 'thnakd', name: 'thnakd', fieldLabel: 'NIM : ', hidden: true, width: 150 }, { xtype: 'textfield', id: 'biayaa', name: 'biayaa', fieldLabel: 'NIM : ', hidden: true, width: 150 }, { xtype: 'textfield', id: 'jnskls', name: 'jnskls', fieldLabel: 'NIM : ', hidden: true, width: 150 }], listeners: { rowclick: function rowClick(grid, rowIdx) { var rec = ds_nya1.getAt(rowIdx); var smt = 0; var thn = 0; var byy = 0; var kls = 0; smt = rec.get('kdstsemester'); thn = rec.get('thnakademik'); byy = parseFloat(rec.get('biaya')); kls = rec.get('jeniskelas'); Ext.getCmp('stsmt').setValue(smt); Ext.getCmp('thnakd').setValue(thn); Ext.getCmp('biayaa').setValue(byy); Ext.getCmp('jnskls').setValue(kls); getMhsDetDPP(); } } }); //============================================================= /** GRID DPK/DPP */ var gDPKDPP = { //new Ext.form.FormPanel({ xtype: 'panel', //'container', id: 'content.dpkdpp', //layout: 'hbox', layout: 'form', margin: '0 0 10', defaults: { labelWidth: 150, labelAlign: 'right' }, items: [{ xtype: 'fieldset', flex: 1, title: 'DPK', defaults: { labelWidth: 130, xtype: 'textfield', width: 800, labelAlign: 'right' }, items: [ grid_nya, { xtype: 'fieldset', border: false, items: [{ layout: 'column', border: false, items: [{ columnWidth: .60, layout: 'form', border: false, items: [{ xtype: 'textfield', // fieldLabel: 'First Name', hidden: true, name: 'first', anchor: '95%' } ] }, { columnWidth: .40, layout: 'form', border: false, items: [{ xtype: 'numericfield', style: 'text-align: right;', labelStyle: 'width:200px;', fieldLabel: 'Total Bayar DPK', id: 'totdpk', name: 'totdpk', width: 109, allowBlank: false, readOnly: true, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', listeners: {} } ] } ] }] } ] }, { xtype: 'fieldset', flex: 1, title: 'DPP', defaults: { labelWidth: 130, xtype: 'textfield', width: 800, labelAlign: 'right' }, items: [ grid_nya1 ] }] }; //); return gDPKDPP; }