//ALL FIELDS DOSEN function allFields_dos() { return new Object([ //EXTRA FROM OTHER TABLES { name: "nmpt", mapping: "nmpt" } , { name: "nmfakultas", mapping: "nmfakultas" } , { name: "nourutprodi", mapping: "nourutprodi" } , { name: "nmprodi", mapping: "nmprodi" } , { name: "lnmprodi", mapping: "lnmprodi" } , { name: "nmjenjangstudi", mapping: "nmjenjangstudi" } , { name: "nmstaktiv", mapping: "nmstaktiv" } , { name: "nmstikj", mapping: "nmstikj" } , { name: "nmkotkab", mapping: "nmkotkab" } //PERSONAL , { name: "kdprodi", mapping: "kdprodi" } , { name: "kdstdosen", mapping: "kdstdosen" } , { name: "nidu", mapping: "nidu" } , { name: "nup", mapping: "nup" } , { name: "nidn", mapping: "nidn" } , { name: "nmdostpgelar", mapping: "nmdostpgelar" } , { name: "nmdosdgngelar", mapping: "nmdosdgngelar" } , { name: "gelardpn", mapping: "gelardpn" } , { name: "gelarblk", mapping: "gelarblk" } , { name: "gelartertinggi", mapping: "gelartertinggi" } , { name: "nup", mapping: "nup" } , { name: "tptlahir", mapping: "tptlahir" } , { name: "tgllahir", mapping: "tgllahir" } , { name: "kdjnskelamin", mapping: "kdjnskelamin" } , { name: "kdjabakademik", mapping: "kdjabakademik" } , { name: "noktp", mapping: "noktp" } , { name: "kdpendidikantertinggi", mapping: "kdpendidikantertinggi" } , { name: "kdstikatankerjadosen", mapping: "kdstikatankerjadosen" } , { name: "kdstaktivitasdosen", mapping: "kdstaktivitasdosen" } , { name: "kdstsemester", mapping: "kdstsemester" } , { name: "nippns", mapping: "nippns" } , { name: "kdpt", mapping: "kdpt" } , { name: "idgoldarah", mapping: "idgoldarah" } , { name: "kdwarga", mapping: "kdwarga" } , { name: "foto", mapping: "foto" } , { name: "alamat", mapping: "alamat" } , { name: "kelurahan", mapping: "kelurahan" } , { name: "kecamatan", mapping: "kecamatan" } , { name: "kdkotkab", mapping: "kdkotkab" } , { name: "kdpos", mapping: "kdpos" } , { name: "notelp", mapping: "notelp" } , { name: "email", mapping: "email" } , { name: "facebook", mapping: "facebook" } , { name: "twitter", mapping: "twitter" } , { name: "pinbb", mapping: "pinbb" } , { name: "website", mapping: "website" } , { name: "catatan", mapping: "catatan" } /* , { name: "abcd", mapping: "abcd" } , { name: "abcd", mapping: "abcd" } , { name: "abcd", mapping: "abcd" } , { name: "abcd", mapping: "abcd" } */ ]); }; function wGridDos(){ //DATA STORE var ds_dos = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'dosen_controller/get_dos_long', method: 'POST', success: function(response) { var x = Ext.decode(response.responseText); if(x.status == false){ Ext.Ajax.request({ url: BASE_URL + 'user/ext_logout', method: 'POST', success: function(xhr) { localStorage.removeItem('access_token'); window.location = BASE_URL + 'user/login'; } }); } } }), baseParams: { start: 0, limit: 20, key: RH.getKeyPar(), value: RH.getValPar(), }, listeners:{ beforeload : function(store) { //PARAMETERS FOR SEARCH BAR store.baseParams.key = RH.getKeyPar(); store.baseParams.value = RH.getValPar(); } }, totalProperty: 'results', autoLoad: true, root: 'data', fields: allFields_dos(), }); //SEARCH BAR PARAMS var searchParObj = new Object([ { 'key': 'nidu', 'name': 'NIDU' } , { 'key': 'nidn', 'name': 'NIDN' } , { 'key': 'nmdosdgngelar', 'name': 'Nama (dgn gelar)' } , { 'key': 'nmprodi', 'name': 'Program Studi' } , { 'key': 'nmstaktiv', 'name': 'Status Aktiv' } , { 'key': 'nmstikj', 'name': 'Status Ikatan Kerja' } ]); RH.searchObj_init(); // MUST to INITIALIZE RH.searchObj.textWidth = 200; RH.searchObj.params = searchParObj; // MUST OVR RH.searchObj.store = ds_dos; // MUST OVR //COLUMN MODEL var cm_dosen = new Ext.grid.ColumnModel([{ header: 'NIDU', width: 100, dataIndex: 'nidu', sortable: true }, { header: 'NIDN', width: 100, dataIndex: 'nidn', sortable: true }, { header: 'Nama Dosen', width: 200, hidden:true, dataIndex: 'nmdostpgelar', sortable: true }, { header: 'Nama Dosen (dgn gelar)', width: 200, dataIndex: 'nmdosdgngelar', sortable: true, hidden:false, }, { header: '(L/P)', width: 40, dataIndex: 'kdjnskelamin', sortable: true }, { header: 'Program Studi', width: 160, dataIndex: 'nmprodi', sortable: true }, { header: 'Status Aktiv', width: 100, dataIndex: 'nmstaktiv', sortable: true }, { header: 'St. Ikatan Kerja', width: 100, dataIndex: 'nmstikj', sortable: true }] ); // Selection Model var sm_dos = new Ext.grid.RowSelectionModel({ singleSelect: true }); // Grid View var gv_dos = new Ext.grid.GridView({ emptyText: '< Belum ada Data >' }); //GRID PANEL var gp_dos = new Ext.grid.GridPanel({ ds: ds_dos, cm: cm_dosen, sm: sm_dos, view: gv_dos, forceFit: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, clicksToEdit: 1, //buttonAlign: 'left', layout: 'anchor', /* tbar: [{hidden:true, text: 'Print', iconCls: 'silk-printer', }, '->'], plugins: gSearch, */ tbar:[RH.searchBar()], bbar: new Ext.PagingToolbar({ store: ds_dos, displayInfo: true, displayMsg: 'Data {0} - {1} dari {2}', emptyMsg: "Belum ada data", }), listeners: { rowdblclick: dblclk_dos } }); var win_dos = new Ext.Window({ title: 'Daftar Dosen', modal: true, layout: 'fit', width: 800, height: 400, items: [gp_dos] }).show(); function dblclk_dos(grid, rowIdx) { var rec = ds_dos.getAt(rowIdx); var nidu = rec.data['nidu']; var nidn = rec.data['nidn']; var nama_s = rec.data['nmdostpgelar']; var nama_l = rec.data['nmdosdgngelar']; var fakultas = rec.data['nmfakultas']; var prodi = rec.data['nmprodi']; var nmstaktiv = rec.data['nmstaktiv']; var nmstikj = rec.data['nmstikj']; var foto = rec.data['foto']; if(nama_l == '' || nama_l == null) nama_l = nama_s; //SETUP disableDosContents(); resetDosContents(); RH.resetForm('fp.dosDispPanel'); Ext.getCmp('tb.save-dos').disable(); Ext.getCmp('tb.update-dos').disable(); Ext.getCmp('tp.dosTabs').setActiveTab(0); //ADD HISTORY GRID (Riwayat Pendidikan Dosen) fnGetRiwayatpdk(nidu); //di fnDosen.js //NIDU disable Ext.getCmp('tf.nidu-dos').disable(); // disabling the combos which create NIDU Ext.getCmp('cb.prodi-dos').disable(); Ext.getCmp('cb.status-dos').disable(); //FORM DISPLAY -- RH.setCompValue('file_gambar',foto); RH.setCompValue('frm.nidu',nidu); RH.setCompValue('frm.nidn',nidn); //RH.setCompValue('frm.nama_s',nama_s); RH.setCompValue('frm.nama_l-dos',nama_l); RH.setCompValue('frm.fakultas-dos',fakultas); RH.setCompValue('frm.prodi-dos',prodi); RH.setCompValue('frm.staktiv-dos',nmstaktiv); RH.setCompValue('frm.stikj-dos',nmstikj); RH.setCompValue('frm.foto',foto); //PERSONAL TAB --- RH.setCompValue('cb.prodi-dos',rec.data['kdprodi']), RH.setCompValue('cb.status-dos',rec.data['kdstdosen']), RH.setCompValue('tf.nidu-dos',nidu); RH.setCompValue('tf.nidn-dos',rec.data['nidn']); RH.setCompValue('tf.nup-dos',rec.data['nup']); RH.setCompValue('tf.nama-dos',rec.data['nmdostpgelar']); RH.setCompValue('tf.namawgelar-dos',rec.data['nmdosdgngelar']); RH.setCompValue('tf.glrdpn-dos',rec.data['gelardpn']); RH.setCompValue('tf.glrblk-dos',rec.data['gelarblk']); RH.setCompValue('tf.glrtop-dos',rec.data['gelartertinggi']); RH.setCompValue('tf.tplahir-dos',rec.data['tptlahir']), RH.setCompValue('df.tglahir-dos',rec.data['tgllahir']), RH.setCompValue('cb.gender-dos',rec.data['kdjnskelamin']); RH.setCompValue('cb.jabak-dos',rec.data['kdjabakademik']), RH.setCompValue('tf.noktp-dos',rec.data['noktp']), RH.setCompValue('cb.pdktop-dos',rec.data['kdpendidikantertinggi']), RH.setCompValue('cb.stikj-dos',rec.data['kdstikatankerjadosen']), RH.setCompValue('cb.staktiv-dos',rec.data['kdstaktivitasdosen']), RH.setCompValue('cb.smt-dos',rec.data['kdstsemester']), RH.setCompValue('tf.nip-dos',rec.data['nippns']), RH.setCompValue('tf.kdhome-dos',rec.data['kdpt']), RH.setCompValue('tf.nmhome-dos',rec.data['nmpt']), RH.setCompValue('cb.goldarah-dos',rec.data['idgoldarah']), RH.setCompValue('cb.wn-dos',rec.data['kdwarga']), //KONTAK RH.setCompValue('tf.alamat-dos',rec.data['alamat']), RH.setCompValue('tf.kel-dos',rec.data['kelurahan']), RH.setCompValue('tf.kec-dos',rec.data['kecamatan']), RH.setCompValue('tf.kdkota-dos',rec.data['kdkotkab']), RH.setCompValue('tf.nmkota-dos',rec.data['nmkotkab']), RH.setCompValue('tf.kdpos-dos',rec.data['kdpos']), RH.setCompValue('tf.telp-dos',rec.data['notelp']), RH.setCompValue('tf.email-dos',rec.data['email']), RH.setCompValue('tf.fb-dos',rec.data['facebook']), RH.setCompValue('tf.twit-dos',rec.data['twitter']), RH.setCompValue('tf.pinbb-dos',rec.data['pinbb']), RH.setCompValue('tf.web-dos',rec.data['website']), //LAIN TAB's Fields RH.setCompValue('ta.notes-dos',rec.data['catatan']), /* RH.setCompValue('fform',rec.data['field']); RH.setCompValue('fform',rec.data['field']); */ win_dos.close(); } };