function daftar_dsn(){ /** COMMON STORES */ var ds_prodireg = store_prodireg(); var ds_years = store_tahun(); /** STORE for GRID COLUMN EDITOR type COMBO */ /** MAIN GRID STORE: fields_dsnIKULUM */ var fields_dsn = RH.storeFields( 'nidu' , 'nmdosdgngelar' , 'kdjnskelamin' , 'nmprodi' , 'nmfakultas' , 'ttl' , 'jabatanakademik' , 'stikatankerjadosen' , 'stdosen' , 'alamat' , 'notelp' , 'email' , 'website'); var pageSize = 50; var fields_dsn = RH.JsonStore({ url : BASE_URL + 'dosen_controller/get_daftar_dosen', fields : fields_dsn, limit: pageSize, params: [ {key:'kdprodi', id:'cb.prodi-dos'} //,{key:'thnmasuk', id:'cb.thmasuk-mhs'} ], enableSearch: true, }); //SEARCH COMPONENT /** FUNCTION for GRID COLUMN EDITOR */ /** GRID COLUMN MODEL */ var cm_dsn = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer({width: 48}), //for rows numbering { header: 'NIDU', width: 100, dataIndex: 'nidu', sortable: true, },{ header: 'Nama Dosen', width: 250, dataIndex: 'nmdosdgngelar', sortable: true, },{ header: 'L/P', width: 60, dataIndex: 'kdjnskelamin', sortable: true, align: 'center' },{ header: 'Fakultas', width: 150, dataIndex: 'nmfakultas', sortable: true, },{ header: 'Prodi', width: 150, dataIndex: 'nmprodi', sortable: true, },{ header: 'Tempat Tgl.Lahir', width: 150, dataIndex: 'ttl', sortable: true, },{ header: 'Jabatan Akademik', width: 100, dataIndex: 'jabatanakademik', sortable: true, },{ header: 'St.Kerja', width: 100, dataIndex: 'stikatankerjadosen', sortable: true, },{ header: 'St.Dosen', width: 100, dataIndex: 'stdosen', sortable: true, },{ header: 'Alamat', width: 250, dataIndex: 'alamat', sortable: true, },{ header: 'No.Hp', width: 100, dataIndex: 'notelp', sortable: true, },{ header: 'Email', width: 150, dataIndex: 'email', sortable: true, },{ header: 'Web/ Blog', width: 150, dataIndex: 'website', sortable: true, }] ); var gp_dsn = RH.EditorGridPanel_T1({ ds: fields_dsn, cm: cm_dsn, singleSelect: true, clicksToEdit: 1, //allowAdd: true, pageSize: pageSize, cellclick: '', }); var fp_daftar_dsn = RH.GPContainer1_wHeaders({ title: 'Daftar Dosen', iconCls:'silk-book', gridPanel: gp_dsn, headerLabelWidth: 140, headers: [{ xtype: 'container', layout: 'hbox', items:[{ layout:'form', labelWidth:90, labelAlign:'right', items: [ RH.ActionCombo({ id: 'cb.prodi-dos', label: 'Program Studi', width: 350, data: ds_prodireg, key: 'kdprodi', display: 'lnmprodi', fnSelect: function(){ reloadGriddsn(); } }) ] },/* { layout:'form', labelWidth:160, labelAlign:'right', items: [ RH.ActionCombo({ id: 'cb.thmasuk-mhs', label: 'Thn.Masuk/Angkatan', width: 100, data: ds_years, key: 'kode', display: 'nama', fnSelect: function(){ reloadGriddsn(); } }) ] }, */{ xtype:'button', iconCls:'silk-printer', text:'Cetak', margins:'0 0 0 10', handler: function(){ fnPrintDaftarDsn(); } },{ xtype: 'button', id: 'btn_excel_dftr_mhs', iconCls: 'silk-save', text: ' Export To Excel', handler: function() { export_excel_dftr_dos(); } }] },{ xtype: 'textfield', id: 'hidden.kdmk', hidden:true, }], }); SET_PAGE_CONTENT(fp_daftar_dsn); function reloadGriddsn(){ fields_dsn.reload({ params: { kdprodi: RH.getCompValue('cb.prodi-dos', true), } }); } } function fnPrintDaftarDsn(){ var kdprodi = RH.getCompValue('cb.prodi-dos'); if(kdprodi){ RH.ShowReport(BASE_URL + 'rpt/rpt_daftar_dsn/get_daftar_dsn/'+kdprodi); }else{ Ext.MessageBox.alert("Info", "Pilih Program Studi."); } } //excel function export_excel_dftr_dos(){ var tablename = 'excel_daftar_dsn'; var waitmsgexport = Ext.MessageBox.wait('Exporting Data...', 'Info'); var kdprodi = RH.getCompValue('cb.prodi-dos'); if(kdprodi){ Ext.Ajax.request({ url: BASE_URL + 'dosen_controller/get_export_tbl_excel', params: { kdprodi: kdprodi }, success: function() { waitmsgexport.hide(); window.location = BASE_URL + 'dosen_controller/export_excel/'+tablename; }, failure: function() { waitmsgexport.hide(); Ext.MessageBox.alert("Info", "Export Data Gagal"); } }); }else{ Ext.MessageBox.alert("Info", "Pilih Program Studi."); } }