function resetMhsContents(){ Ext.getCmp('fp.mhsTabPanel').getForm().reset(); /* Ext.getCmp('content.personal').getForm().reset(); Ext.getCmp('content.ortu').getForm().reset(); Ext.getCmp('content.daftar').getForm().reset(); Ext.getCmp('content.slta').getForm().reset(); Ext.getCmp('content.asalpt').getForm().reset(); Ext.getCmp('content.pekerjaan').getForm().reset(); Ext.getCmp('content.alumni').getForm().reset(); Ext.getCmp('content.datalain').getForm().reset(); */ }; function setDispMhs(){ var id = Ext.getCmp('tf.npm-mhs').getValue(); var name = Ext.getCmp('tf.nama-mhs').getValue(); var faculty = RH.getFieldValue('cb.prodireg', 'kdprodi', 'nmfakultas'); var prody = RH.getFieldValue('cb.prodireg', 'kdprodi', 'lnmprodi'); //Ext.getCmp('cb.prodireg').getRawValue(); var inyear = Ext.getCmp('cb.thmasuk').getValue(); var stactiv = RH.getFieldValue('cb.staktiv', 'kode', 'nama'); //Ext.getCmp('cb.staktiv').getRawValue(); var stfirst = RH.getFieldValue('cb.stawal', 'kode', 'nama'); //Ext.getCmp('cb.stawal').getRawValue(); Ext.getCmp('frm.npm').setValue(id); Ext.getCmp('frm.nama').setValue(name); Ext.getCmp('frm.fakultas').setValue(faculty); Ext.getCmp('frm.prodi').setValue(prody); Ext.getCmp('frm.thmasuk').setValue(inyear); Ext.getCmp('frm.staktiv').setValue(stactiv); Ext.getCmp('frm.stawal').setValue(stfirst); }; function setMhsForm(npm, nama){ resetMhsContents(); Ext.getCmp('fp.mhsFDisp').getForm().reset(); Ext.getCmp('tb.save-mhs').disable(); Ext.getCmp('tb.update-mhs').disable(); //set form Ext.getCmp('tf.npm-mhs').setValue(npm); Ext.getCmp('frm.npm').setValue(npm); Ext.getCmp('tf.nama-mhs').setValue(nama); Ext.getCmp('frm.nama').setValue(nama); //set tab 0 active Ext.getCmp('tabpanel-mhs').setActiveTab(0); //test //Ext.getCmp('cb.gender-mhs').setValue('L'); } ////////////// // GET PARAMETERS FOR INSERT function getInsertParams(){ return new Object({ //PERSONAL TAB's Fields nim : Ext.getCmp('tf.npm-mhs').getValue() , noktp : Ext.getCmp('tf.noktp-mhs').getValue(), nmmhs : Ext.getCmp('tf.nama-mhs').getValue() , kdjnskelamin : Ext.getCmp('cb.gender-mhs').getValue(), tptlahir : Ext.getCmp('tf.tplahir-mhs').getValue(), tgllahir : Ext.getCmp('df.tglahir-mhs').getValue(), kdagama : Ext.getCmp('cb.agama-mhs').getValue(), idgoldarah : Ext.getCmp('cb.goldarah-mhs').getValue(), kdwn : Ext.getCmp('cb.wn-mhs').getValue(), notelpmhs : Ext.getCmp('tf.telp-mhs').getValue(), nohpmhs : Ext.getCmp('tf.hp-mhs').getValue(), alamatasal : Ext.getCmp('tf.alamat_asal-mhs').getValue(), kelurahanasal : Ext.getCmp('tf.kel_asal-mhs').getValue(), kecamatanasal : Ext.getCmp('tf.kec_asal-mhs').getValue(), kdkotkabasal : Ext.getCmp('tf.kdkota_asal-mhs').getValue(), kdposasal : Ext.getCmp('tf.kdpos_asal-mhs').getValue(), alamatsurat : Ext.getCmp('tf.alamat_surat-mhs').getValue(), kelurahansurat : Ext.getCmp('tf.kel_surat-mhs').getValue(), kecamatansurat : Ext.getCmp('tf.kec_surat-mhs').getValue(), kdkotkabsurat : Ext.getCmp('tf.kdkota_surat-mhs').getValue(), kdpossurat : Ext.getCmp('tf.kdpos_surat-mhs').getValue(), //ORTU (IBU) TAB's Fields nmortu : Ext.getCmp('tf.namaortu').getValue(), idpekerjaanortu : Ext.getCmp('cb.jobortu').getValue(), idpendidikanortu : Ext.getCmp('cb.eduortu').getValue(), alamatortu : Ext.getCmp('tf.alamatortu').getValue(), kelurahanortu : Ext.getCmp('tf.kelortu').getValue(), kecamatanortu : Ext.getCmp('tf.kecortu').getValue(), kdkotkabortu : Ext.getCmp('tf.kdkotaortu').getValue(), kdposortu : Ext.getCmp('tf.kdposortu').getValue(), notelportu : Ext.getCmp('tf.tlportu').getValue(), //ORTU (AYAH) TAB's Fields nmortuayah : Ext.getCmp('tf.namaortuayah').getValue(), idpekerjaanortuayah : Ext.getCmp('cb.jobortuayah').getValue(), idpendidikanortuayah : Ext.getCmp('cb.eduortuayah').getValue(), alamatortuayah : Ext.getCmp('tf.alamatortuayah').getValue(), kelurahanortuayah : Ext.getCmp('tf.kelortuayah').getValue(), kecamatanortuayah : Ext.getCmp('tf.kecortuayah').getValue(), kdkotkabortuayah : Ext.getCmp('tf.kdkotaortuayah').getValue(), kdposortuayah : Ext.getCmp('tf.kdposortuayah').getValue(), notelportuayah : Ext.getCmp('tf.tlportuayah').getValue(), //DAFTAR TAB's Fields /* nopmb : Ext.getCmp('tf.nopmb').getValue(), kdstsemester : Ext.getCmp('cb.stsmt').getValue(), kdprodi : Ext.getCmp('cb.prodireg').getValue(), shiftmhs : Ext.getCmp('cb.shift').getValue(), idklsmhs : Ext.getCmp('cb.class').getValue(), thnmasuk : Ext.getCmp('cb.thmasuk').getValue(), tglmasuk : Ext.getCmp('df.tgmasuk').getValue(), kdstawalmhs : Ext.getCmp('cb.stawal').getValue(), kdstaktivitasmhs : Ext.getCmp('cb.staktiv').getValue(), kdpropinsislta : Ext.getCmp('lu.kdpropinsislta').getValue(), btsstudi : Ext.getCmp('cb.batasstudi').getValue(), */ //SLTA TAB's Fields nmslta : Ext.getCmp('tf.nmslta').getValue(), kdkotkabslta : Ext.getCmp('tf.kdkotaslta').getValue(), idjnsslta : Ext.getCmp('cb.jnslta').getValue(), idstakreditasislta : Ext.getCmp('cb.stakrslta').getValue(), thnlulusslta : Ext.getCmp('cb.thlulusslta').getValue(), nemslta : Ext.getCmp('tf.nemslta').getValue(), rangkingslta : Ext.getCmp('tf.rankslta').getValue(), noijazahslta : Ext.getCmp('tf.noijzslta').getValue(), tglijazahslta : Ext.getCmp('df.tgijzslta').getValue(), // ASAL PT/PINDAHAN kdptasal : Ext.getCmp('tf.kdpt-asal').getValue(), nmptasal : Ext.getCmp('tf.nmpt-asal').getValue(), idjnspt : Ext.getCmp('cb.jnpt-asal').getValue(), idstakreditasi : Ext.getCmp('cb.stakr-asal').getValue(), idkuakreditasi : Ext.getCmp('cb.kuakr-asal').getValue(), kdjenjangstudiasal : Ext.getCmp('tf.jjgstudi-asal').getValue(), fakultasasal : Ext.getCmp('tf.fakultas-asal').getValue(), kdprodiasal : Ext.getCmp('tf.kdprodi-asal').getValue(), nmprodiasal : Ext.getCmp('tf.nmprodi-asal').getValue(), nimasal : Ext.getCmp('tf.npm-asal').getValue(), noijazahasal : Ext.getCmp('tf.noijzpt-asal').getValue(), tglijazahasal : Ext.getCmp('df.tgijzpt-asal').getValue(), idsemesterpindah : Ext.getCmp('nf.smtpindah-asal').getValue(), jmlsksdiakui : Ext.getCmp('nf.jumsks-asal').getValue(), alasanpindah : Ext.getCmp('ta.alasanpindah').getValue(), // PEKERJAAN MAHASISWA idpekerjaanmhs : Ext.getCmp('cb.idjob-mhs').getValue(), nmtptbekerjamhs : Ext.getCmp('tf.tpjob-mhs').getValue(), alamatkerkamhs : Ext.getCmp('tf.alamatjob-mhs').getValue(), jabatanmhs : Ext.getCmp('tf.jabjob-mhs').getValue(), // ALUMNI idpekerjaanalumni : Ext.getCmp('cb.idjob-alumni').getValue(), nmtptbekerjaalumni : Ext.getCmp('tf.tpjob-alumni').getValue(), alamatkerjaalumni : Ext.getCmp('tf.alamatjob-alumni').getValue(), jabatanalumni : Ext.getCmp('tf.jabjob-alumni').getValue(), thnkeluar : Ext.getCmp('cb.thout-alumni').getValue(), tgllulus : Ext.getCmp('df.tglulus-alumni').getValue(), /* idstatusalumni : Ext.getCmp('status_alumni').getValue(), notranskrip : Ext.getCmp('notranskrip').getValue(), noijazah : Ext.getCmp('noijazah').getValue(), ketuayayasan : Ext.getCmp('ketua_yayasan').getValue(), tglijazah : Ext.getCmp('tglijazah').getValue(), idpimpinan1 : Ext.getCmp('pimpinan1').getValue(), tgltandatangan : Ext.getCmp('tgltandatangan').getValue(), */ //S3 /* kdbiayastudi : Ext.getCmp('cb.biaya-s3').getValue(), kdpttptbekerja : Ext.getCmp('tf.kdpt-s3').getValue(), nmpttptbekerja : Ext.getCmp('tf.nmpt-s3').getValue(), kdproditptbekerja : Ext.getCmp('tf.kdprodi-s3').getValue(), nmproditptbekerja : Ext.getCmp('tf.nmprodi-s3').getValue(), nidupromotor : Ext.getCmp('tf.nippro').getValue(), nidukopromotor1 : Ext.getCmp('tf.nipko1').getValue(), nidukopromotor2 : Ext.getCmp('tf.nipko2').getValue(), nidukopromotor3 : Ext.getCmp('tf.nipko3').getValue(), nidukopromotor4 : Ext.getCmp('tf.nipko4').getValue(), */ //SKRIPSI jdlskripsiind : Ext.getCmp('skripsi_ind').getValue(), jdlskripsieng : Ext.getCmp('skripsi_eng').getValue(), idpembimbing : (Ext.getCmp('id_pembimbing').getValue()) ? Ext.getCmp('id_pembimbing').getValue() : Ext.getCmp('nama_pembimbing').getValue(), idpembimbing1 : (Ext.getCmp('id_pembimbing1').getValue()) ? Ext.getCmp('id_pembimbing1').getValue() : Ext.getCmp('nama_pembimbing1').getValue(), nmperusahaan : Ext.getCmp('perusahaan').getValue(), tglperiode1 : Ext.getCmp('dari_tgl').getValue(), tglperiode2 : Ext.getCmp('sampai_tgl').getValue(), tglsidang : Ext.getCmp('tgl_sidang').getValue(), penyidang1 : Ext.getCmp('id_penyidang1').getValue(), penyidang2 : Ext.getCmp('id_penyidang2').getValue(), //LAINNYA email : Ext.getCmp('tf.email-mhs').getValue(), facebook : Ext.getCmp('tf.fb-mhs').getValue(), twitter : Ext.getCmp('tf.twit-mhs').getValue(), pinbb : Ext.getCmp('tf.pinbb-mhs').getValue(), website : Ext.getCmp('tf.web-mhs').getValue(), //abc : Ext.getCmp('').getValue(), foto : Ext.getCmp('frm.foto').getValue(), }); } function upload_foto_mhs(namaForm) { var form_nya = Ext.getCmp(namaForm); form_nya.getForm().submit({ url: BASE_URL + 'mahasiswa_controller/upload', method: 'POST', params: { npm :Ext.getCmp('tf.npm-mhs').getValue(), oldphoto:Ext.getCmp('frm.foto').getValue(), newphoto:Ext.getCmp('file_gambar').getValue() }, success: function(form_bp_general, o) { if (o.result.success == 'true') { mhs_foto_ori(o.result.newfile); Ext.getCmp('frm.foto').setValue(o.result.newfile); updateMhs(); } else if (o.result.success == 'false1') { Ext.MessageBox.alert('Informasi', 'File ' + o.result.nama + ' gagal di upload, Ukuran file maksimal 800 kb'); } else if (o.result.success == 'false2') { Ext.MessageBox.alert('Informasi', 'File ' + o.result.nama + ' gagal di upload, File harus ber tipe image'); } } }); } function updateMhs(){ // SETUP PARAMETER var idForm = 'fp.mhsTabPanel'; var sUrl = BASE_URL +'mahasiswa_controller/update_mhs'; var sParams = getInsertParams(); //getUpdateParams(); var msgWait = 'Tunggu, sedang proses update...'; var msgSuccess = 'Update data berhasil'; var msgFail = 'Update data gagal'; var msgInvalid = 'Data belum valid (data primer belum terisi)!'; var waitmsg = Ext.MessageBox.wait('Tunggu, sedang proses...', 'Info'); Ext.Ajax.request({ url: sUrl, method: 'POST', params: sParams, success: function() { waitmsg.hide(); Ext.Msg.alert("Info", "Ubah Data Berhasil"); afterSaveSuccess(); }, failure: function(result){ waitmsg.hide(); Ext.MessageBox.alert("Info", "Ubah Data Gagal"); } }); } function afterSaveSuccess(){ Ext.getCmp('tb.save-mhs').disable(); Ext.getCmp('tb.update-mhs').disable(); disableMhsContents(); setDispMhs(); } function enableMhsContents(look){ // pake nama variabel jika di-declare dgn new Ext.form.FormPanel({ //fPersonal.enable(); fOrtu.enable(); fDaftar.enable(); //fSlta.enable(); fAsalpt.enable(); fPekerjaan.enable(); //fAlumni.enable(); fData_s3.enable(); fDatalain.enable(); //bisa pake id Ext.getCmp('tabpanel-mhs').setActiveTab(0); Ext.getCmp('content.personal').enable(); Ext.getCmp('content.ortu').enable(); Ext.getCmp('content.asalpt').enable(); Ext.getCmp('content.slta').enable(); if (look=='1') { Ext.getCmp('content.daftar').enable(); } else { Ext.getCmp('content.daftar').disable(); if (Ext.getCmp('cb.stawal').getValue() == 'B') { Ext.getCmp('content.asalpt').disable(); Ext.getCmp('content.slta').enable(); } else if (Ext.getCmp('cb.stawal').getValue() == 'P') { Ext.getCmp('content.asalpt').enable(); Ext.getCmp('content.slta').disable(); } //if (Ext.getCmp('idtextcatnonaktif').getValue() == '4') { Ext.getCmp('content.skripsi').enable(); //} } Ext.getCmp('content.pekerjaan').enable(); Ext.getCmp('content.alumni').enable(); //Ext.getCmp('content.s3').enable(); Ext.getCmp('content.datalain').enable(); Ext.getCmp('tb.update-mhs').enable(); } function disableMhsContents(){ // pake nama variabel jika di-declare dgn new Ext.form.FormPanel({ //fPersonal.disable(); fOrtu.disable(); fDaftar.disable(); //fSlta.disable(); fAsalpt.disable(); fPekerjaan.disable(); //fAlumni.disable(); fData_s3.disable(); fDatalain.disable(); //bisa pake id Ext.getCmp('content.personal').disable(); Ext.getCmp('content.ortu').disable(); Ext.getCmp('content.daftar').disable(); Ext.getCmp('content.slta').disable(); Ext.getCmp('content.asalpt').disable(); Ext.getCmp('content.pekerjaan').disable(); Ext.getCmp('content.skripsi').disable(); Ext.getCmp('content.alumni').disable(); //Ext.getCmp('content.s3').disable(); Ext.getCmp('content.datalain').disable(); }; function lookup_kota_mhs(id){ var ds_kota = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'mahasiswa_controller/grid_kotkabasalmhs', method: 'POST' }), autoLoad: true, root: 'data', totalProperty: 'results', fields: [ { name: 'kdkabtbpro', mapping: 'kdkabtbpro' },{ name: 'nmprotbpro', mapping: 'nmprotbpro' }, { name: 'nmkabtbpro', mapping: 'nmkabtbpro' }] }); var cm_kota = new Ext.grid.ColumnModel([ { hidden:true, header: 'kdkabtbpro', dataIndex: 'kdkabtbpro', width: 200 },{ header: 'Propinsi', dataIndex: 'nmprotbpro', width: 80 },{ header: 'Kab/Kota', dataIndex: 'nmkabtbpro', width: 200 } ]); var sm_kota = new Ext.grid.RowSelectionModel({ singleSelect: true }); var vw_kota = new Ext.grid.GridView({ emptyText: '< Belum ada Data >' }); var paging_kota = new Ext.PagingToolbar({ pageSize: 50, store: ds_kota, displayInfo: true, displayMsg: 'Data Kab/Kota Dari {0} - {1} of {2}', emptyMsg: 'No data to display' }); var cari_kota = [new Ext.ux.grid.Search({ iconCls: 'btn_search', minChars: 1, autoFocus: true, position: 'top', mode: 'remote', width: 200 })]; var grid_find_kota = new Ext.grid.GridPanel({ ds: ds_kota, cm: cm_kota, sm: sm_kota, view: vw_kota, height: 350, width: 400, plugins: cari_kota, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, buttonAlign: 'left', layout: 'anchor', anchorSize: { width: 400, height: 400 }, tbar: [], bbar: paging_kota, listeners: { rowdblclick: dobelklikkota } }); var win_find_kota = new Ext.Window({ title: "Data Kota/Kabupaten", modal: true, items: [grid_find_kota] }).show(); function dobelklikkota(grid, rowIdx) { var rec_kota = ds_kota.getAt(rowIdx); var var_kota1 = rec_kota.data["kdkabtbpro"]; var var_kota2 = rec_kota.data["nmkabtbpro"]; var var_kota3 = rec_kota.data["nmprotbpro"]; if(id==1){ Ext.getCmp("tf.kdkota_asal-mhs").setValue(var_kota1); Ext.getCmp("tf.kota_asal-mhs").setValue(var_kota2); }else if(id==2){ Ext.getCmp("tf.kdkota_surat-mhs").setValue(var_kota1); Ext.getCmp("tf.kota_surat-mhs").setValue(var_kota2); }else if(id==3){ Ext.getCmp("tf.kdkotaortu").setValue(var_kota1); Ext.getCmp("tf.kotaortu").setValue(var_kota2); }else if(id==4){ Ext.getCmp("tf.kdkotaslta").setValue(var_kota1); Ext.getCmp("tf.kotaslta").setValue(var_kota2); }else if(id==5){ Ext.getCmp("tf.kdkotaortuayah").setValue(var_kota1); Ext.getCmp("tf.kotaortuayah").setValue(var_kota2); } win_find_kota.close(); } } function lookup_pt_mhs(){ var ds_pt = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'c_mastah/grid_ptasal', method: 'POST' }), autoLoad: true, root: 'data', totalProperty: 'results', fields: [ { name: 'kdptitbpti', mapping: 'kdptitbpti' },{ name: 'nmptitbpti', mapping: 'nmptitbpti' }] }); var cm_pt = new Ext.grid.ColumnModel([ { header: 'Kode', dataIndex: 'kdptitbpti', width: 80 },{ header: 'Nama', dataIndex: 'nmptitbpti', width: 200 } ]); var sm_pt = new Ext.grid.RowSelectionModel({ singleSelect: true }); var vw_pt = new Ext.grid.GridView({ emptyText: '< Belum ada Data >' }); var paging_pt = new Ext.PagingToolbar({ pageSize: 50, store: ds_pt, displayInfo: true, displayMsg: 'Data PT Dari {0} - {1} of {2}', emptyMsg: 'No data to display' }); var cari_pt = [new Ext.ux.grid.Search({ iconCls: 'btn_search', minChars: 1, autoFocus: true, position: 'top', mode: 'remote', width: 200 })]; var grid_find_pt = new Ext.grid.GridPanel({ ds: ds_pt, cm: cm_pt, sm: sm_pt, view: vw_pt, height: 350, width: 400, plugins: cari_pt, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, buttonAlign: 'left', layout: 'anchor', anchorSize: { width: 400, height: 400 }, tbar: [], bbar: paging_pt, listeners: { rowdblclick: dobelklikpt } }); var win_find_pt = new Ext.Window({ title: "Data Perguruan Tinggi", modal: true, items: [grid_find_pt] }).show(); function dobelklikpt(grid, rowIdx) { var rec_pt = ds_pt.getAt(rowIdx); var var_pt1 = rec_pt.data["kdptitbpti"]; var var_pt2 = rec_pt.data["nmptitbpti"]; Ext.getCmp("tf.kdpt-asal").setValue(var_pt1); Ext.getCmp("tf.nmpt-asal").setValue(var_pt2); win_find_pt.close(); } } function lookup_prodi_mhs(){ var ds_prodi = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'c_mastah/grid_prodiasal', method: 'POST' }), autoLoad: true, root: 'data', totalProperty: 'results', fields: [ { name: 'kdpsttbpst', mapping: 'kdpsttbpst' },{ name: 'nmpsttbpst', mapping: 'nmpsttbpst' }] }); var cm_prodi = new Ext.grid.ColumnModel([ { header: 'Kode Prodi', dataIndex: 'kdpsttbpst', width: 80 },{ header: 'Nama Prodi', dataIndex: 'nmpsttbpst', width: 200 } ]); var sm_prodi = new Ext.grid.RowSelectionModel({ singleSelect: true }); var vw_prodi = new Ext.grid.GridView({ emptyText: '< Belum ada Data >' }); var paging_prodi = new Ext.PagingToolbar({ pageSize: 50, store: ds_prodi, displayInfo: true, displayMsg: 'Data Program Studi Dari {0} - {1} of {2}', emptyMsg: 'No data to display' }); var cari_prodi = [new Ext.ux.grid.Search({ iconCls: 'btn_search', minChars: 1, autoFocus: true, position: 'top', mode: 'remote', width: 200 })]; var grid_find_prodi = new Ext.grid.GridPanel({ ds: ds_prodi, cm: cm_prodi, sm: sm_prodi, view: vw_prodi, height: 350, width: 400, plugins: cari_prodi, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, buttonAlign: 'left', layout: 'anchor', anchorSize: { width: 400, height: 400 }, tbar: [], bbar: paging_prodi, listeners: { rowdblclick: dobelklikprodi } }); var win_find_prodi = new Ext.Window({ title: "Data Program Studi", modal: true, items: [grid_find_prodi] }).show(); function dobelklikprodi(grid, rowIdx) { var rec_prodi = ds_prodi.getAt(rowIdx); var var_prodi1 = rec_prodi.data["kdpsttbpst"]; var var_prodi2 = rec_prodi.data["nmpsttbpst"]; Ext.getCmp("tf.kdprodi-asal").setValue(var_prodi1); Ext.getCmp("tf.nmprodi-asal").setValue(var_prodi2); win_find_prodi.close(); } } //DOSEN MHS function lookup_dosen_mhs(option){ var ds_dosen = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'c_mastah/griddosen', 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'; } }); } } }), autoLoad: true, root: 'data', totalProperty: 'results', fields: [{ name: 'nidu', mapping: 'nidu' },{ name: 'nidn', mapping: 'nidn' },{ name: 'nmdosdgngelar', mapping: 'nmdosdgngelar' },{ name: 'notelp', mapping: 'notelp' }] }); var cm_dosen = new Ext.grid.ColumnModel([{ header: 'NIDU', width: 70, dataIndex: 'nidu', sortable: true }, { header: 'NIDN', width: 100, dataIndex: 'nidn', sortable: true }, { header: 'Nama Dosen', width: 220, dataIndex: 'nmdosdgngelar', sortable: true }, { header: 'No. Telp', width: 100, dataIndex: 'notelp', sortable: true }] ); var sm_dosen = new Ext.grid.RowSelectionModel({ singleSelect: true }); var vw_dosen = new Ext.grid.GridView({ emptyText: '< Belum ada Data >' }); var paging_dosen = new Ext.PagingToolbar({ pageSize: 50, store: ds_dosen, displayInfo: true, displayMsg: 'Data PT Dari {0} - {1} of {2}', emptyMsg: 'No data to display' }); var cari_dosen = [new Ext.ux.grid.Search({ iconCls: 'btn_search', minChars: 1, autoFocus: true, position: 'top', mode: 'local', width: 200 })]; var grid_find_dosen = new Ext.grid.GridPanel({ ds: ds_dosen, cm: cm_dosen, sm: sm_dosen, view: vw_dosen, height: 350, width: 450, plugins: cari_dosen, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, buttonAlign: 'left', layout: 'anchor', anchorSize: { width: 400, height: 400 }, tbar: [], bbar: paging_dosen, listeners: { rowdblclick: dobelklikdosen } }); var win_find_dosen = new Ext.Window({ title: "Daftar Dosen", modal: true, items: [grid_find_dosen] }).show(); function dobelklikdosen(grid, rowIdx) { var rec_dosen = ds_dosen.getAt(rowIdx); if (option=='pembimbing') { Ext.getCmp("id_pembimbing").setValue(rec_dosen.data["nidu"]); Ext.getCmp("nama_pembimbing").setValue(rec_dosen.data["nmdosdgngelar"]); } else if (option=='pembimbing1') { Ext.getCmp("id_pembimbing1").setValue(rec_dosen.data["nidu"]); Ext.getCmp("nama_pembimbing1").setValue(rec_dosen.data["nmdosdgngelar"]); } else if (option=='penyidang1') { Ext.getCmp("id_penyidang1").setValue(rec_dosen.data["nidu"]); Ext.getCmp("nama_penyidang1").setValue(rec_dosen.data["nmdosdgngelar"]); } else if (option=='penyidang2') { Ext.getCmp("id_penyidang2").setValue(rec_dosen.data["nidu"]); Ext.getCmp("nama_penyidang2").setValue(rec_dosen.data["nmdosdgngelar"]); } win_find_dosen.close(); } }