function f_tracerstudy(idmhs,nim) { var ds_gender = store_gender(); var ds_prodi = store_prodi(); var ds_fakultas = store_fakultas(); var ds_mhsjob = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'data_controller/get_mhsjob', method: 'POST' }), totalProperty: 'results', root: 'data', autoLoad: true, fields: [{ name: 'id', mapping: 'id' }, { name: 'nama', mapping: 'nama' }] }); var form_tracer_study = new Ext.form.FormPanel({ title: "TRACER STUDY ALUMNI", border: true, frame: true, renderTo: "div_tracerstudyform", id: 'form_tracer_study', labelAlign: 'left', buttonAlign: 'left', bodyStyle: 'padding:5px 3px 3px 5px', autoHeight:true, width: 900, autoScroll: true, layout: 'form', items: [ //Data diri { xtype: 'fieldset', title: 'Data Alumni', defaults :{ labelStyle: 'text-align: right;width:170px;', }, items: [ { xtype: 'textfield', id: 'tf.npm', fieldLabel: 'NPM', submitValue: true, width: 250, disabled: true, }, { xtype: 'textfield', id: 'tf.nmmhs', fieldLabel: 'Nama', submitValue: true, width: 250, disabled: true, name: "nmmhs" }, { xtype: 'combo', id: 'cb.jk', fieldLabel: 'Jenis Kelamin', store: ds_gender, triggerAction: 'all', valueField: 'kode', displayField: 'nama', forceSelection: true, submitValue: true, mode: 'local', hiddenName: 'h_jk', emptyText:'Pilih...', selectOnFocus:false, disabled: true, }, { xtype: 'textfield', id: 'cb.fakultas', fieldLabel: 'Fakultas', submitValue: true, width: 250, disabled: true, name: "nmmhs" },{ xtype: 'textfield', id: 'cb.prodi', fieldLabel: 'Prodi', submitValue: true, width: 250, disabled: true, name: "nmmhs" }, { xtype: 'textfield', id: 'tf.thnmasuk', fieldLabel: 'Tahun Masuk', submitValue: true, disabled: true, //name: "thnmasuk" }, { xtype: 'textfield', id: 'tf.thnlulus', fieldLabel: 'Tahun Lulus', submitValue: true, disabled: true, //name: "thnkeluar" }] }, //bekerja { xtype: 'fieldset', title: 'Data Pekerjaan', defaults :{ labelStyle: 'text-align: right;width:170px;', }, items: [{ xtype: 'combo', id: 'cb.idpekerjaanalumni', fieldLabel: 'Pekerjaan', width: 300, editable: false, hiddenName: 'idpekerjaanalumni', store: ds_mhsjob, triggerAction: 'all', valueField: 'id', displayField: 'nama', forceSelection: true, submitValue: true, mode: 'local', emptyText:'Pilih...', //selectOnFocus:true, },{ xtype: 'datefield', id: 'tglbekerja_alumni', fieldLabel: 'Tanggal Bekerja', format: 'Y-m-d' //value: new Date(), }, { xtype: 'textfield', id: 'nmtptbekerjaalumni', fieldLabel: 'Nama Perusahaan', submitValue: true, width: 250, }, { xtype: 'textarea', id: 'alamatkerjaalumni', fieldLabel: 'Alamat Perusahaan', submitValue: true, width: 250, }, { xtype: 'textfield', id: 'jabatanalumni', fieldLabel: 'Pekerjaan/ Jabatan', submitValue: true, width: 250, }] }, //pendidikan lanjutan { xtype: 'fieldset', title: 'Data Pendidikan', defaults :{ labelStyle: 'text-align: right;width:170px;', }, items: [{ xtype: 'combo', id: 'cb.pl', fieldLabel: 'Melanjutkan Pendidikan?', store: ['Ya','Tidak'], triggerAction: 'all', forceSelection: true, submitValue: true, mode: 'local', emptyText:'Pilih...', selectOnFocus:false, listeners: { select: function(combo, record) { var mp = Ext.getCmp("cb.pl").getValue(); if(mp == "Ya"){ Ext.getCmp("jenjang_alumni").enable(); Ext.getCmp("pt_alumni").enable(); Ext.getCmp("bidangilmu_alumni").enable(); }else{ Ext.getCmp("jenjang_alumni").disable(); Ext.getCmp("pt_alumni").disable(); Ext.getCmp("bidangilmu_alumni").disable(); Ext.getCmp("jenjang_alumni").setValue(null); Ext.getCmp("pt_alumni").setValue(null); Ext.getCmp("bidangilmu_alumni").setValue(null); } } } },{ xtype: 'textfield', id: 'jenjang_alumni', fieldLabel: 'Jenjang Pendidikan Berikutnya', submitValue: true, disabled: true, width: 100, }, { xtype: 'textfield', id: 'pt_alumni', fieldLabel: 'Nama Perguruan Tinggi', submitValue: true, disabled: true, width: 250, },{ xtype: 'textfield', id: 'bidangilmu_alumni', fieldLabel: 'Bidang Ilmu', submitValue: true, disabled: true, width: 250, }, { xtype: 'combo', id: 'cb.bi', fieldLabel: 'Bidang Ilmu', store: '', triggerAction: 'all', hidden: true, //valueField: 'kode', displayField: 'nama', forceSelection: true, submitValue: true, mode: 'local', emptyText:'Pilih...', selectOnFocus:false, disabled: true, width: 250, }] }, //button update { xtype: 'fieldset', layout: 'column', height:60, border: true, items: [{ columnWidth: .15, border: true, layout: 'anchor', items: [{ xtype: 'button', id: 'bkirim', width:70, align:'top', text: 'Simpan', iconCls: 'silk-save', handler: function() { if (nim != '') { simpan_grid('form_tracer_study'); } } }] }] } ], listeners: { afterrender: function () { module_afterrender(); }, beforerender: function () { Ext.getCmp("form_tracer_study").setHeight(document.getElementById("div_tracerstudyform").clientHeight); Ext.getCmp("form_tracer_study").doLayout(); Ext.EventManager.onWindowResize(function () { Ext.getCmp("form_tracer_study").setHeight(document.getElementById("div_tracerstudyform").clientHeight); Ext.getCmp("form_tracer_study").doLayout(); }); } } }); function module_afterrender(){ var waitmsg = Ext.MessageBox.wait('Proses mendapatkan data...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'tracerstudy/tracerstudy_controller/grid', method: 'POST', params :{ idmhs: idmhs, nim: nim }, scope: this, async:false, success: function(result){ waitmsg.hide(); var jsonData = Ext.decode(result.responseText); //bisa utk Ext3 dan Ext4 var dataArray = jsonData.data; var data = dataArray[0]; if (data) { Ext.getCmp('tf.npm').setValue(data.nim); Ext.getCmp('tf.nmmhs').setValue(data.nmmhs); Ext.getCmp('tf.thnmasuk').setValue(data.thnmasuk); Ext.getCmp('tf.thnlulus').setValue(data.thnkeluar); Ext.getCmp('cb.jk').setValue(data.kdjnskelamin); Ext.getCmp('cb.prodi').setValue(data.nmprodi); Ext.getCmp('cb.fakultas').setValue(data.nmfakultas); Ext.getCmp('cb.idpekerjaanalumni').setValue(data.idpekerjaanalumni); Ext.getCmp('nmtptbekerjaalumni').setValue(data.nmtptbekerjaalumni); Ext.getCmp('alamatkerjaalumni').setValue(data.alamatkerjaalumni); Ext.getCmp('jabatanalumni').setValue(data.jabatanalumni); Ext.getCmp('tglbekerja_alumni').setValue(data.tglbekerja_alumni); Ext.getCmp('jenjang_alumni').setValue(data.jenjang_alumni); Ext.getCmp('pt_alumni').setValue(data.pt_alumni); Ext.getCmp('bidangilmu_alumni').setValue(data.bidangilmu_alumni); if (data.jenjang_alumni || data.pt_alumni || data.bidangilmu_alumni) { Ext.getCmp('cb.pl').setValue('Ya'); } else { Ext.getCmp('cb.pl').setValue('Tidak'); } } else { Ext.getCmp('cb.idpekerjaanalumni').disable(); Ext.getCmp('nmtptbekerjaalumni').disable(); Ext.getCmp('alamatkerjaalumni').disable(); Ext.getCmp('jabatanalumni').disable(); Ext.getCmp('tglbekerja_alumni').disable(); Ext.getCmp('cb.pl').disable(); Ext.getCmp('bkirim').disable(); } } }); } function simpan_grid(namaForm) { var form_nya = Ext.getCmp(namaForm); form_nya.getForm().submit({ url: BASE_URL + 'tracerstudy/tracerstudy_controller/update', method: 'POST', params:{ nim : nim, }, success: function() { Ext.MessageBox.alert("Informasi", "Simpan Data Berhasil"); }, failure: function() { Ext.MessageBox.alert("Informasi", "Simpan Data Gagal"); } }); } /* function loaddata(namaForm) { if (id != null) { var form_nya = Ext.getCmp(namaForm); form_nya.getForm().load({ url: BASE_URL + 'qurbanonline/data_qurban_controller/get_qurban', params:{ noqurban : id }, success: function(form, action){ }, failure: function(form, action){ Ext.MessageBox.alert('Informasi', 'Proses Mendapatkan Data Gagal'); }, waitMsg:'Proses Mendapatkan Data...' }); } if (arr) { $('html, body').animate({ scrollTop: 210 }, 'fast'); Ext.getCmp("nmpemesan").setValue(arr.nmpemesan); Ext.getCmp("alamat").setValue(arr.alamat); Ext.getCmp("notelp").setValue(arr.notelp); Ext.getCmp("email").setValue(arr.email); } } function total() { var arrhrg = Ext.getCmp("hrghewan").getValue().split("&"); var hrghewan = (parseFloat(arrhrg[3])) ? parseFloat(arrhrg[3]):0; var shodaqoh = (Ext.getCmp("shodaqoh").getValue()) ? Ext.getCmp("shodaqoh").getValue():0; var total = (parseFloat(shodaqoh) + hrghewan); Ext.getCmp("total").setValue(total); } function simpan_grid(namaForm) { var form_nya = Ext.getCmp(namaForm); //var waitmsgsave = Ext.MessageBox.wait('Tunggu, sedang proses menyimpan data....', 'Info'); var arrhrghewan = Ext.getCmp("hrghewan").getValue().split("&"); var idprogram = arrhrghewan[0]; var idjnshewan = arrhrghewan[1]; var idklshewan = arrhrghewan[2]; var hrghewan = arrhrghewan[3]; form_nya.getForm().submit({ url: BASE_URL + 'qurbanonline/data_qurban_controller/insert_qurban', method: 'POST', params: { idprogram:idprogram, idjnshewan:idjnshewan, idklshewan:idklshewan, nominal:hrghewan, }, success: function(form_tracer_study, o) { //waitmsgsave.hide(); //Ext.MessageBox.alert('Informasi', 'Simpan Data Berhasil'); Ext.getCmp("msgfail").hide(); document.location = ''; }, failure: function(form_tracer_study, o) { //waitmsgsave.hide(); Ext.getCmp("msgfail").show(); //Ext.MessageBox.alert('Informasi', 'Simpan Data Gagal'); } }); } function reset(namaForm) { var form_nya = Ext.getCmp(namaForm); form_nya.getForm().reset(); Ext.getCmp("msgfail").hide(); } */ //fPanel.render(document.getElementById("div_pmbform")); }