function pJadwal_ujian(){ /** COMMON STORES */ var ds_prodireg = store_prodireg(); var ds_stsmt = store_stsmt(); var ds_jujian = store_jujian(); /** GRID STORE: ds_jadwaluj */ var fields_jadwaluj = RH.storeFields('kdprodi','kdstsemester','kdmk','nmmkind','idsemester','nmruangan','waktu', 'jmlsks','nidu','nmdosdgngelar','nmprodi','darijam','sampaijam','tglujian','nmasisten','nmdosen','idkelas','nmkelas'); var pageSize = 10; var ds_jadwaluj = RH.JsonStore({ url : BASE_URL + 'jadwaluj_controller/get_jadwaluj', fields : fields_jadwaluj, //limit : pageSize, params: [ {key:'kdprodi', id: 'cb.prodi-stru'} ,{key:'kdstsemester', id: 'cb.smt-stru'} ,{key:'idjnsujian', id: 'cb.jujian'} ], enableSearch: true, }); ds_jadwaluj.on('beforeload', function(){ RH.removeDetail('fp.detil') }); //STORE SEARCH var ds_search = new Ext.data.JsonStore({ //static data autoDestroy: true, fields: [ 'field', 'value' ], data: [ { "field":"Kode Mata Kuliah","value":"kdmk"}, { "field":"Nama Mata Kuliah","value":"nmmkind"}, { "field":"Tanggal","value":"tglujian"}, { "field":"Waktu","value":"waktu"}, { "field":"Kelas","value":"nmkelas"}, { "field":"Dosen","value":"nmdosdgngelar"} ] }); /** GRID COLUMN MODEL */ var cm_jadwaluj = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer({ width:35 }), //for rows numbering { header: RH.h3('Tanggal','c'), width:70, dataIndex: 'tglujian', renderer: Ext.util.Format.dateRenderer('d/m/Y'), sortable: true }, { header: RH.h3('Waktu'), width:120, dataIndex: 'waktu', sortable: true },{ header: RH.h3('Ruang'), width:150, dataIndex: 'nmruangan', sortable: true },{ header: RH.h3('Kode','c'), width:70, dataIndex: 'kdmk', sortable: true }, { header: RH.h3('Mata Kuliah'), width: 250, dataIndex: 'nmmkind', sortable: true, },{ header: RH.h3('Kelas'), width:120, dataIndex: 'nmkelas', sortable: true },{ header: RH.h3('SKS'), width: 40, dataIndex: 'jmlsks', align:'center', sortable: true, },{ header: RH.h3('Dosen'), width: 250, dataIndex: 'nmdosdgngelar', sortable: true, }, { header: RH.h3('Asisten'), width: 250, dataIndex: 'nmasisten', sortable: true, }] ); // Selection Model var sm_jadwaluj = new Ext.grid.RowSelectionModel({ singleSelect: true }); // Grid View var gv_jadwaluj = new Ext.grid.GridView({emptyText: '< Belum ada Data >'}); /** GRID PANEL */ var gp_jadwaluj = new Ext.grid.EditorGridPanel({ //PAKE EditorGridPanel ds: ds_jadwaluj, cm: cm_jadwaluj, sm: sm_jadwaluj, view: gv_jadwaluj, clicksToEdit: 1, //for cell editing (single click =1, dblclick=2) forceFit: true, //autoHeight: true, layout:'anchor', //autoSizeColumns: true, //autoExpandColumn: 'nmmkind', autoScroll:true, //enableColumnResize: true, columnLines: true, loadMask: true, tbar:[{ xtype: 'combo', fieldLabel: '', width:150, id:'cb.search', autoWidth: true, store: ds_search, valueField: 'value', displayField: 'field', editable: false, allowBlank: true, triggerAction: 'all',forceSelection: true, submitValue: true, mode: 'local', emptyText:'Cari berdasarkan ...', },{ xtype: 'textfield', id: 'tf.search', margins:'0 0 0 5', width:150, },{ xtype: 'button', id: 'bsearch', margins:'0 0 0 5', iconCls: 'silk-zoom', handler: function() { if(RH.isEmpty('cb.search')) return; ds_jadwaluj.reload({ params: { key: RH.getCompValue('cb.search'), value: RH.getCompValue('tf.search'), }, }); } }], /* bbar: new Ext.PagingToolbar({ store: ds_jadwaluj, displayInfo: true, pageSize: pageSize, mode: 'local', displayMsg: 'Data {0} - {1} dari {2}', emptyMsg: "Belum ada data" }) */ }); var fp_jadwaluj = new Ext.Panel({ xtype: 'form', title: 'Jadwal Ujian', iconCls:'silk-book', buttonAlign: 'left', bodyStyle: 'padding: 5px', border: false, layout: 'border', waitMsg: 'Waiting...', maskDisabled: false, monitorValid: true, autoScroll:true, frame: true, items: [{ xtype: 'fieldset', flex: 1, region:'north', layout:'form', autoHeight:true, items: [{ xtype: 'container', layout: 'hbox', items:[{ layout:'form', labelWidth:90, labelAlign:'right', items: [ RH.ActionCombo({ id: 'cb.prodi-stru', label: 'Program Studi', width: 300, data: ds_prodireg, key: 'kdprodi', display: 'lnmprodi', fnSelect: function(){ reloadGridJadwalUj(); } }) ] },{ layout:'form', labelWidth:140, labelAlign:'right', items: [ RH.ActionCombo({ id: 'cb.smt-stru', label: 'Tahun Akademik', width: 160, data: ds_stsmt, key: 'kdstsemester', display: 'nmsmt', fnSelect: function(){ reloadGridJadwalUj(); } }) ] },{ layout:'form', labelWidth:140, labelAlign:'right', items: [ RH.ActionCombo({ id: 'cb.jujian', label: 'Jenis Ujian', width: 160, data: ds_jujian, key: 'idjnsujian', display: 'kdjnsujian', fnSelect: function(){ reloadGridJadwalUj(); } }) ] },{ xtype: 'textfield', id: 'hidden.kdmk', hidden:true, }] }] },{ region: 'center', layout:'form', autoScroll:true, items:[{ xtype: 'panel', layout:'fit', height:450, title:'Mata Kuliah', id:'fp.master', frame:true, items: [gp_jadwaluj], tbar: [{ text: 'Cetak', id: 'tb.add-stru', iconCls: 'silk-printer', handler: function(){ fnPrintJadwaluj(); } }] }], }] }); /** FUNCTIONS */ function fnPrintJadwaluj(){ var prodi = RH.getCompValue('cb.prodi-stru'); var tahun = RH.getCompValue('cb.smt-stru'); var jujian = RH.getCompValue('cb.jujian'); var key = RH.getCompValue('cb.search'); var value = RH.getCompValue('tf.search'); if(prodi && tahun && jujian){ RH.ShowReport(BASE_URL + 'rpt/rpt_jadwaluj/get_jadwal_ujian/'+prodi+'/'+tahun+'/'+jujian+'/'+key+'/'+value); } else {} } function reloadGridJadwalUj(){ var prodi = RH.getCompValue('cb.prodi-stru'); var tahun = RH.getCompValue('cb.smt-stru'); var jujian = RH.getCompValue('cb.jujian'); //remove detail RH.removeDetail('fp.detil'); //reload master-grid if(prodi && tahun && jujian){ ds_jadwaluj.reload({ params: { kdprodi: prodi, kdstsemester: tahun, idjnsujian: jujian } }); } } SET_PAGE_CONTENT(fp_jadwaluj); }