function f_daftarusm() { var ds_grid = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'pendaftaran/c_daftar_usm/grid', method: 'POST', }), baseParams: { tglusm:new Date().format('Y-m-d') }, totalProperty: 'results', autoLoad : true, root: 'data', fields: [ { name: 'nopmb' } , { name: 'nokuitansipmb' } , { name: 'nama' } , { name: 'kdjk' } , { name: 'tmpttgllhr' } , { name: 'nmstmskmhs' } , { name: 'nmklsmhs1' } , { name: 'nmprodi1' } , { name: 'nmklsmhs2' } , { name: 'nmprodi2' } , { name: 'nmjadwalusm' } , { name: 'tglusm' } , { name: "jamusm" } , { name: "nominal" } , { name: "nmsetbiayapmb" } ] }); var cm = new Ext.grid.ColumnModel({ columns: [ new Ext.grid.RowNumberer({width:45}), { header: RH.h3('No.PMB'), width: 100, dataIndex: 'nopmb', align: 'center', sortable: true }, { header: RH.h3('No.Kuitansi PMB'), width: 100, dataIndex: 'nokuitansipmb', align: 'center', sortable: true }, { header: RH.h3('Nama'), width: 200, dataIndex: 'nama', sortable: true }, { header: RH.h3('(L/P)'), width: 50, dataIndex: 'kdjk', align: 'center', sortable: true }, { header: RH.h3('Tempat/ Tgl.Lahir'), width: 150, dataIndex: 'tmpttgllhr', sortable: true }, { header: RH.h3('Status Pendaftar'), width: 100, dataIndex: 'nmstmskmhs', sortable: true }, { header: RH.h3('Prodi.Pilihan 1'), width: 200, dataIndex: 'nmprodi1', sortable: true }, { header: RH.h3('Kls.Pilihan 1'), width: 150, dataIndex: 'nmklsmhs1', sortable: true }, { header: RH.h3('Prodi.Pilihan 2'), width: 200, dataIndex: 'nmprodi2', sortable: true }, { header: RH.h3('Kls.Pilihan 2'), width: 150, dataIndex: 'nmklsmhs2', sortable: true }, { header: RH.h3('Jenis USM'), width: 130, dataIndex: 'nmjadwalusm', sortable: true }, { header: RH.h3('Tgl.USM'), width: 100, dataIndex: 'tglusm', align: 'center', sortable: true }, { header: RH.h3('Jam USM'), width: 150, dataIndex: 'jamusm', align: 'center', sortable: true }, { header: RH.h3('Jenis Pembayaran'), width: 250, dataIndex: 'nmsetbiayapmb', sortable: true }] }); var cari_data_nya = [new Ext.ux.grid.Search({ iconCls: 'btn_search', minChars: 1, autoFocus: true, autoHeight: true, position: 'top', mode: 'local', width: 200 })]; var grid_nya = new Ext.grid.GridPanel({ id: 'gp.dftrusm', plugins: cari_data_nya, ds: ds_grid, cm: cm, sm: new Ext.grid.RowSelectionModel({ singleSelect: true}), view: new Ext.grid.GridView({ emptyText: '< Belum ada Data >'}), forceFit: true, //autoHeight: true, width: 720, tbar: [{ xtype: 'buttongroup', title: 'Pencarian Berdasarkan Tanggal USM', columns: 4, width: 500, defaults: { scale: 'small' }, items: [{ text: 'Tgl.USM :' },{ xtype: 'datefield', name: 'idtglusm', id: 'idtglusm', width: 150, value: new Date() },{ xtype: 'button', text: ' Cari ', iconCls: 'silk-find', id: 'btn_data', width: 3, handler: function() { setGridDftrUsm(); } },{ xtype: 'button', id: 'btn_excel', iconCls: 'silk-save', text: ' Excel', handler: function() { var tglusm = Ext.getCmp('idtglusm').getValue(); if (tglusm) { exportdata(); } else { Ext.MessageBox.alert("Informasi", "Pilih Tanggal USM"); } } }] }], frame:false, autoScroll: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, layout: 'anchor', }); var form_bp_general = new Ext.Panel({ autoWidth: true, title: 'Daftar Peserta USM', id: 'fp.dftrusm', layout: 'form', forceFit: true, autoScroll: true, margin: '0 0 10', frame: true, defaults: { labelWidth: 200, labelAlign: 'right'}, items: [ { region: 'center', layout:'form', autoScroll:true, items:[{ xtype: 'panel', layout:'fit', height:525, id:'fp.usm', frame:true, items: [grid_nya] }] } ] }) function setGridDftrUsm(){ if(RH.isEmpty('idtglusm')) return; //if(RH.isEmpty('btn_data')) return; var tglusm = RH.getCompValue('idtglusm'); //alert(tglusm); ds_grid.reload({ params: { tglusm: tglusm, }, }); } function exportdata(){ var idtglusm = Ext.getCmp('idtglusm').getValue().format('Y-m-d'); window.location = BASE_URL + 'pendaftaran/c_daftar_usm/export_excel/'+idtglusm; } get_content(form_bp_general); }