//ALL FIELDS DOSEN function searchFields_kwi() { return new Object([ //EXTRA FROM OTHER TABLES { name: "nokuitansi" } , { name: "tglkuitansi" } , { name: "nim" } , { name: "nmmhs" } , { name: "kdprodi" } , { name: "nmprodi" } , { name: "thnmasuk" } , { name: "idjnskls" } , { name: "nmjnskls" } , { name: "noref" } , { name: "jmlbayar" } , { name: "useridinput" } , { name: "idjnsbiaya" } , { name: "kdjnsbiaya" } , { name: "nmjnsbiaya" } , { name: "idcarabyr" } , { name: "nmcarabyr" } , { name: "idstkuitansi" } , { name: "nmstkuitansi" } , { name: "kdstsemester" } , { name: "nmthnakademik" } ]); }; function wGridKwi(){ //DATA STORE var ds_kwi = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'kwitansi_controller/lookup_kwitansi', method: 'POST' }), baseParams: { start: 0, limit: 18 , key: RH.getKeyPar(), value: RH.getValPar(), }, listeners:{ beforeload : function(store) { store.baseParams.key = RH.getKeyPar(); store.baseParams.value = RH.getValPar(); } }, totalProperty: 'results', autoLoad: true, root: 'data', fields: searchFields_kwi(), }); //SEARCH OBJ var searchParObj = new Object([ { 'key': 'nokuitansi', 'name': 'No. Kuitansi' } , { 'key': 'noref', 'name': 'No. Referensi' } , { 'key': 'nim', 'name': 'NPM' } , { 'key': 'nmmhs', 'name': 'Nama Mahasiswa' } ]); RH.searchObj_init(); // MUST to INITIALIZE RH.searchObj.textWidth = 250; RH.searchObj.params = searchParObj; // MUST OVR RH.searchObj.store = ds_kwi; // MUST OVR //COLUMN MODEL var cm_kwi = new Ext.grid.ColumnModel([{ header: 'No. Kuitansi', width: 100, dataIndex: 'nokuitansi', sortable: true }, { header: 'Tgl. Kuitansi', width: 70, dataIndex: 'tglkuitansi', sortable: true }, { header: 'Tahun Akademik - Semester', width: 160, dataIndex: 'nmthnakademik', sortable: true }, { header: 'NPM', width: 100, dataIndex: 'nim', sortable: true }, { header: 'Nama Mahasiswa', width: 160, dataIndex: 'nmmhs', sortable: true, }, { header: 'Biaya', width: 50, dataIndex: 'kdjnsbiaya', sortable: true }, { header: 'Cara Bayar', width: 80, dataIndex: 'nmcarabyr', sortable: true }, { header: 'No. Ref', width: 100, dataIndex: 'noref', sortable: true }, { header: 'Jumlah Bayar', width: 100, dataIndex: 'jmlbayar', //sortable: true, xtype: 'numbercolumn', format:'0,000', align:'right' }, { header: 'Penerima', width: 80, dataIndex: 'useridinput', sortable: true }, { header: 'Status', width: 60, dataIndex: 'nmstkuitansi', sortable: true }] ); // Selection Model var sm_kwi = new Ext.grid.RowSelectionModel({ singleSelect: true }); // Grid View var gv_kwi = new Ext.grid.GridView({ emptyText: '< Belum ada Data >' }); //GRID PANEL var gp_kwi = new Ext.grid.GridPanel({ ds: ds_kwi, cm: cm_kwi, sm: sm_kwi, view: gv_kwi, forceFit: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, layout: 'anchor', tbar: [RH.searchBar()], bbar: new Ext.PagingToolbar({ store: ds_kwi, displayInfo: true, displayMsg: 'Data {0} - {1} dari {2}', emptyMsg: "Belum ada data", }), listeners: { rowdblclick: dblclk_kwi } }); var win_kwi = new Ext.Window({ title: 'Daftar Kuitansi', modal: true, layout: 'fit', width: 900, height: 400, items: [gp_kwi] }).show(); function dblclk_kwi(grid, rowIdx) { var rec = ds_kwi.getAt(rowIdx); var nokuitansi = rec.data['nokuitansi']; var tglkuitansi = rec.data['tglkuitansi']; var noref = rec.data['noref']; var idcarabyr = rec.data['idcarabyr']; var nim = rec.data['nim']; var nmmhs = rec.data['nmmhs']; var kdprodi = rec.data['kdprodi']; var nmprodi = rec.data['nmprodi']; var thnmasuk = rec.data['thnmasuk']; var idjnskls = rec.data['idjnskls']; var nmjnskls = rec.data['nmjnskls']; var idjnsbiaya = rec.data['idjnsbiaya']; var kdstsemester = rec.data['kdstsemester']; var jmlbayar = rec.data['jmlbayar']; //SETUP RH.resetForm('fp.keubayar'); Ext.getCmp('bt.save-kwi').disable(); Ext.getCmp('bt.cancel-kwi').enable(); Ext.getCmp('fs.kuitansi').disable(); Ext.getCmp('fs.mahasiswa').disable(); Ext.getCmp('fs.pembayaran').disable(); //HIDE (OR SET???) BIAYA, DISKON, TOTAL SUDAH BAYAR, SISA // DO HERE //SET/SHOW THE NECESSARY INFO RH.setCompValue('tf.nokwi-byr',nokuitansi); RH.setCompValue('df.tgkwi-byr',tglkuitansi); RH.setCompValue('tf.noref-byr',noref); RH.setCompValue('cb.cara-byr',idcarabyr); RH.setCompValue('tf.nim_mhs-byr',nim); RH.setCompValue('tf.nama_mhs-byr',nmmhs); RH.setCompValue('hf.kdprodi-byr',kdprodi); RH.setCompValue('tf.prodi-byr',nmprodi); RH.setCompValue('tf.thmasuk-byr',thnmasuk); RH.setCompValue('hf.idjnskls-byr',idjnskls); RH.setCompValue('tf.jkelas-byr',nmjnskls); RH.setCompValue('cb.jbiaya-byr',idjnsbiaya); RH.setCompValue('cb.stsmt-byr',kdstsemester); RH.setCompValue('hf.kdstsemester-byr',kdstsemester); RH.setCompValue('nf.jum-byr',jmlbayar); setTerbilang(); Ext.getCmp('lb.info-save-cancel').setText('Jumlah uang yang dibayarkan pada kuitansi ini'); win_kwi.close(); } };