function pDashJadKul(){ var fields_jadkul = RH.storeFields('idruangan', 'nmruangan', 'hj11','hj12','hj13','hj14','hj15','hj16', 'hj21','hj22','hj23','hj24','hj25','hj26', 'hj31','hj32','hj33','hj34','hj35','hj36', 'hj41','hj42','hj43','hj44','hj45','hj46', 'hj51','hj52','hj53','hj54','hj55','hj56', 'hj61','hj62','hj63','hj64','hj65','hj66', 'hj71','hj72','hj73','hj74','hj75','hj76' ); var ds_jadkul = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'dashboard_controller/get_AllJadwalKul', method: 'POST' }), root: 'data', totalProperty: 'results', autoLoad: false, fields : fields_jadkul }); /** COLUMN MODEL & RENDERER */ var headwidth = 80 var group = new Ext.ux.grid.ColumnHeaderGroup({ rows: [continentGroupRow, cityGroupRow] }); var cm_jadkul = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer(), //for rows numbering { header: 'Ruangan',width: headwidth, dataIndex: 'nmruangan', sortable: true, align: 'center', renderer: render_bold }, //====================================SENIN { text: 'SENIN', columns: [ { header: '1', width: headwidth, dataIndex: 'hj11', sortable: true, align: 'center', renderer: render_available }, { header: '2', width: headwidth, dataIndex: 'hj12', sortable: true, align: 'center', renderer: render_available }, { header: '3', width: headwidth, dataIndex: 'hj13', sortable: true, align: 'center', renderer: render_available }, { header: '4', width: headwidth, dataIndex: 'hj14', sortable: true, align: 'center', renderer: render_available }, { header: '5', width: headwidth, dataIndex: 'hj15', sortable: true, align: 'center', renderer: render_available }, { header: '6', width: headwidth, dataIndex: 'hj16', sortable: true, align: 'center', renderer: render_available }] }, //====================================SELASA { header: '1', width: headwidth, dataIndex: 'hj21', sortable: true, align: 'center', renderer: render_available }, { header: '2', width: headwidth, dataIndex: 'hj22', sortable: true, align: 'center', renderer: render_available }, { header: '3', width: headwidth, dataIndex: 'hj23', sortable: true, align: 'center', renderer: render_available }, { header: '4', width: headwidth, dataIndex: 'hj24', sortable: true, align: 'center', renderer: render_available }, { header: '5', width: headwidth, dataIndex: 'hj25', sortable: true, align: 'center', renderer: render_available }, { header: '6', width: headwidth, dataIndex: 'hj26', sortable: true, align: 'center', renderer: render_available }, //====================================RABU { header: '1', width: headwidth, dataIndex: 'hj31', sortable: true, align: 'center', renderer: render_available }, { header: '2', width: headwidth, dataIndex: 'hj32', sortable: true, align: 'center', renderer: render_available }, { header: '3', width: headwidth, dataIndex: 'hj33', sortable: true, align: 'center', renderer: render_available }, { header: '4', width: headwidth, dataIndex: 'hj34', sortable: true, align: 'center', renderer: render_available }, { header: '5', width: headwidth, dataIndex: 'hj35', sortable: true, align: 'center', renderer: render_available }, { header: '6', width: headwidth, dataIndex: 'hj36', sortable: true, align: 'center', renderer: render_available }, //====================================KAMIS { header: '1', width: headwidth, dataIndex: 'hj41', sortable: true, align: 'center', renderer: render_available }, { header: '2', width: headwidth, dataIndex: 'hj42', sortable: true, align: 'center', renderer: render_available }, { header: '3', width: headwidth, dataIndex: 'hj43', sortable: true, align: 'center', renderer: render_available }, { header: '4', width: headwidth, dataIndex: 'hj44', sortable: true, align: 'center', renderer: render_available }, { header: '5', width: headwidth, dataIndex: 'hj45', sortable: true, align: 'center', renderer: render_available }, { header: '6', width: headwidth, dataIndex: 'hj46', sortable: true, align: 'center', renderer: render_available }, //====================================JUMAT { header: '1', width: headwidth, dataIndex: 'hj51', sortable: true, align: 'center', renderer: render_available }, { header: '2', width: headwidth, dataIndex: 'hj52', sortable: true, align: 'center', renderer: render_available }, { header: '3', width: headwidth, dataIndex: 'hj53', sortable: true, align: 'center', renderer: render_available }, { header: '4', width: headwidth, dataIndex: 'hj54', sortable: true, align: 'center', renderer: render_available }, { header: '5', width: headwidth, dataIndex: 'hj55', sortable: true, align: 'center', renderer: render_available }, { header: '6', width: headwidth, dataIndex: 'hj56', sortable: true, align: 'center', renderer: render_available }, //====================================SABTU { header: '1', width: headwidth, dataIndex: 'hj61', sortable: true, align: 'center', renderer: render_available }, { header: '2', width: headwidth, dataIndex: 'hj62', sortable: true, align: 'center', renderer: render_available }, { header: '3', width: headwidth, dataIndex: 'hj63', sortable: true, align: 'center', renderer: render_available }, { header: '4', width: headwidth, dataIndex: 'hj64', sortable: true, align: 'center', renderer: render_available }, { header: '5', width: headwidth, dataIndex: 'hj65', sortable: true, align: 'center', renderer: render_available }, { header: '6', width: headwidth, dataIndex: 'hj66', sortable: true, align: 'center', renderer: render_available }, //====================================MINGGU { header: '1', width: headwidth, dataIndex: 'hj71', sortable: true, align: 'center', renderer: render_available }, { header: '2', width: headwidth, dataIndex: 'hj72', sortable: true, align: 'center', renderer: render_available }, { header: '3', width: headwidth, dataIndex: 'hj73', sortable: true, align: 'center', renderer: render_available }, { header: '4', width: headwidth, dataIndex: 'hj74', sortable: true, align: 'center', renderer: render_available }, { header: '5', width: headwidth, dataIndex: 'hj75', sortable: true, align: 'center', renderer: render_available }, { header: '6', width: headwidth, dataIndex: 'hj76', sortable: true, align: 'center', renderer: render_available } ] ); var sm_jadkul = new Ext.grid.RowSelectionModel({ singleSelect: true }); var gv_jadkul = new Ext.grid.GridView({emptyText: '< Belum ada Data >'}); function render_bold(value) { return ''+value+''; } function render_available(value) { Ext.QuickTips.init(); var color, val; if (value == '0'){ color = "green"; val = 'KOSONG'; } else if (value == '1') { color = "blue"; val = 'ISI'; } else if (value > '1') { color = "red"; val = 'BENTROK'; } return '
'+val+'
'; } /** THE GRID */ var gp_jadkul = new Ext.grid.GridPanel({ //PAKE EditorGridPanel ds: ds_jadkul, cm: cm_jadkul, sm: sm_jadkul, view: gv_jadkul, forceFit: true, layout:'anchor', autoScroll:true, columnLines: true, loadMask: true, frame:true, tbar:[{xtype:'tbtext', text:'Tahun Akademik '+KDTHNAKADEMIK+ ' - ' +NMJNSSEMESTER+''}], listeners: { cellclick: onCellJadkulClick } }); var fp_jadkul = RH.GPContainer1({ title: 'Dashboard Jadwal Kuliah', iconCls:'silk-calendar', gridPanel: gp_jadkul, }); get_content(fp_jadkul); ds_jadkul.setBaseParam('kdstsemester', KDSTSEMESTER); ds_jadkul.load(); /** FUNCTIONS */ function onCellJadkulClick(grid, rowIndex, columnIndex, e){ var t = e.getTarget(); var record = gp_jadkul.getStore().getAt(rowIndex); var col = gp_jadkul.getColumnModel().getColumnHeader(columnIndex).substr(3,1); if (t.className == 'keyMasterDetail') { var fields_detjadkul = RH.storeFields('kdprodi','nmprodi','kdmk','nmmkind','nidu','nmdosdgngelar'); var ds_detjadkul = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'dashboard_controller/get_itemjadwalkuliah', method: 'POST' }), root: 'data', totalProperty: 'results', autoLoad: true, baseParams:{ idjam:col, kdstsemester:KDSTSEMESTER, idhari:'1', idruangan:record.data['idruangan'] }, fields : fields_detjadkul }); /** GRID COLUMN MODEL */ var cm_detjadkul = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer(), //for rows numbering { header: RH.h3('Kode Prodi'), width:100, dataIndex: 'kdprodi', sortable: true },{ header: RH.h3('Prodi'), width:200, dataIndex: 'nmprodi', sortable: true },{ header: RH.h3('Kode Matakuliah'), width:100, dataIndex: 'kdmk', sortable: true },{ header: RH.h3('Matakuliah'), width:200, dataIndex: 'nmmkind', sortable: true },{ header: RH.h3('NIDU'), width:100, dataIndex: 'nidu', sortable: true },{ header: RH.h3('Dosen'), width:200, dataIndex: 'nmdosdgngelar', sortable: true } ] ); // Selection Model var sm_detjadkul = new Ext.grid.RowSelectionModel({ singleSelect: true }); // Grid View var gv_detjadkul = new Ext.grid.GridView({emptyText: '< Belum ada Data >'}); /** GRID PANEL DETAIL*/ var gp_detjadkul = new Ext.grid.EditorGridPanel({ //PAKE EditorGridPanel ds: ds_detjadkul, cm: cm_detjadkul, sm: sm_detjadkul, view: gv_detjadkul, clicksToEdit: 1, forceFit: true, autoScroll:true, autoWidth: true, height: 300, width: 755, columnLines: true, loadMask: true, frame: true, tbar:[], bbar: new Ext.PagingToolbar({ }), listeners: { } }); var win = new Ext.Window({ title: 'Detail Jadwal Kuliah', modal: true, items: [gp_detjadkul] }); win.show(); } } }