function stAbsenPicker(arg){ /* arg : idcb_temuke : idcb_temuke, idcb_stabsenmhs : idcb_stabsenmhs, fnSelect_temuke : function(){}, fnSelect_stabsenmhs : function(){} */ var idCbxStabsen = 'cbx.stbsenmhs'; var ds_tatapmuka = store_pertemuan(); var ds_stabsenmhs = store_stabsenmhs(); var header = { xtype: 'fieldset', flex: 1, items:[{ xtype: 'container', layout: 'hbox', items:[{ layout:'form', labelWidth:90, labelAlign:'right', items: [ RH.ActionCombo({ id: arg.idcb_temuke, label: 'Pertemuan ke', width: 50, data: ds_tatapmuka, key: 'kode', display: 'kode', fnSelect: function(){ fnSetStabsenmhs(arg.idcb_temuke, arg.idcb_stabsenmhs, idCbxStabsen)}//arg.fnSelect_temuke }) ] },{ layout:'form', labelWidth:80, labelAlign:'right', items:[{ xtype: 'checkbox', id:idCbxStabsen, fieldLabel:'Pilih Semua', listeners: { change: function(checkbox, newValue, oldValue) { //if(checkbox.getValue()==true){ if(newValue == true){ Ext.getCmp(arg.idcb_temuke).disable(); fnSetStabsenmhs(arg.idcb_temuke, arg.idcb_stabsenmhs, idCbxStabsen); }else{ Ext.getCmp(arg.idcb_temuke).enable(); } } } }] },{ layout:'form', labelWidth:40, labelAlign:'right', items: [ RH.ActionCombo({ id: arg.idcb_stabsenmhs, label: 'Status', width:90, data: ds_stabsenmhs, key: 'idstabsenmhs', display: 'stabsensimhs', fnSelect: function(){ fnSetStabsenmhs(arg.idcb_temuke, arg.idcb_stabsenmhs, idCbxStabsen)}//arg.fnSelect_stabsenmhs }) ] },{ xtype:'button', iconCls:'silk-save', text:'Simpan', margins:'0 0 0 10', handler: function(){ fnSaveAbsensi(); } },{ xtype:'button', iconCls:'silk-printer', text:'Cetak', margins:'0 0 0 10', handler: function(){ fnPrintBlanko(); fnPrintAbsensi(); } }] }] }; return header; } function cAbsenDosen(kdprodi, kdstsemester, kdmk, nidu, idklsmhs){ var ds_stabsensidos = store_stabsensidos(); var ds_jam = store_jam(); function getLabel(np){ var objArr = new Array(); for(var i=0; i'}); /** GRID PANEL */ var gp_absenmhs = new Ext.grid.EditorGridPanel({ id:'gp_absenmhs', ds: ds_absenmhs, cm: cm_absenmhs, sm: sm_absenmhs, view: gv_absenmhs, clicksToEdit: 1, //for cell editing (single click =1, dblclick=2) forceFit: true, height: gpheight, //autoHeight: true, layout:'anchor', autoScroll:true, columnLines: true, loadMask: true, tbar:[{ xtype:'textfield', id:'hidden.nim', hidden:true },{ xtype:'textfield', id:'hidden.updatecol', hidden:true }], bbar: new Ext.PagingToolbar({ store: ds_absenmhs, displayInfo: true, mode: 'local', pageSize: pageSize, displayMsg: 'Data {0} - {1} dari {2}', emptyMsg: "Belum ada data" }), listeners: { cellclick: onCellClick } }); return gp_absenmhs; function onCellClick(grid, rowIndex, columnIndex, e) { var dataIndex = grid.getColumnModel().getDataIndex(columnIndex); var record = grid.getStore().getAt(rowIndex); // Get the Record var nim = record.data['nim']; RH.setCompValue('hidden.nim', nim); RH.setCompValue('hidden.updatecol', dataIndex); } function updateAbsenmhs(idstabsenmhs){ Ext.Ajax.request({ url: BASE_URL + 'absen_controller/update_absenmhs1', params: { kdprodi : kdprodi, kdstsemester : kdstsemester, kdmk : kdmk, nidu : nidu, nim : RH.getCompValue('hidden.nim'), field : RH.getCompValue('hidden.updatecol'), value : idstabsenmhs }, success: function() { ds_absenmhs.reload(); }, failure: function() { Ext.Msg.alert("Info", "Ubah Data Gagal"); } }); } } function fnSetStabsenmhs(idComboTemu, idComboStatus, idCheckBox){ var pertemuan = RH.getCompValue(idComboTemu,true); var status = RH.getCompValue(idComboStatus,true); var getall = Ext.getCmp(idCheckBox).getValue(); if(Ext.getCmp('gp_absenmhs')){ var grid = Ext.getCmp('gp_absenmhs'); var sel_model = grid.getSelectionModel(); var store = grid.getStore(); var numrec = store.getCount(); //jumlah record if(numrec > 0){ for(var i=0; i 0){ for(var i=0; i