function f_jadwalusm() { var ds_grid = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'pendaftaran/c_jadwalusm/grid', method: 'POST' }), params: { start: 0, limit: 5 }, root: 'data', totalProperty: 'results', autoLoad: true, fields: [{ name: "idjadwalusm", mapping: "idjadwalusm" }, { name: "kdjadwalusm", mapping: "kdjadwalusm" }, { name: "nmjadwalusm", mapping: "nmjadwalusm" }, { name: "idjadwalpmb", mapping: "idjadwalpmb" }, { name: "nmjadwalpmb", mapping: "nmjadwalpmb" }, { name: "idstmskmhs", mapping: "idstmskmhs" }, { name: "nmstmskmhs", mapping: "nmstmskmhs" }, { name: "idjnsusm", mapping: "idjnsusm" }, { name: "nmjnsusm", mapping: "nmjnsusm" }, { name: "tglusm", mapping: "tglusm" }, { name: "jamusmdari", mapping: "jamusmdari" }, { name: "jamusmsampai", mapping: "jamusmsampai" }, { name: "idstatus", mapping: "idstatus" }, { name: "nmstatus", mapping: "nmstatus" }] }); var cm = new Ext.grid.ColumnModel({ // specify any defaults for each column defaults: { sortable: true // columns are not sortable by default }, columns: [{ header: 'Kode', width: 100, dataIndex: 'kdjadwalusm', sortable: true }, { header: 'Nama', width: 150, dataIndex: 'nmjadwalusm', sortable: true }, { header: 'Jadwal PMB', width: 250, dataIndex: 'nmjadwalpmb', sortable: true }, { header: 'Status Masuk', width: 100, dataIndex: 'nmstmskmhs', sortable: true }, { header: 'Jenis USM', width: 100, dataIndex: 'nmjnsusm', sortable: true }, { header: 'Tanggal USM', width: 100, dataIndex: 'tglusm', sortable: true }, { header: 'Dari Jam', width: 100, dataIndex: 'jamusmdari', sortable: true }, { header: 'Sampai Jam', width: 100, dataIndex: 'jamusmsampai', sortable: true }, { header: 'Status', width: 100, dataIndex: 'nmstatus', sortable: true }] }); var vw = new Ext.grid.GridView({ emptyText: '< Jadwal USM Belum Dipilih >' }); var sm_nya = new Ext.grid.CheckboxSelectionModel({ listeners: { // rowselect: select_action, // rowdeselect: deselect_action } }); var cari_data = [new Ext.ux.grid.Search({ iconCls: 'btn_search', minChars: 1, autoFocus: true, autoHeight: true, position: 'top', mode: 'local', width: 200 })]; var paging = new Ext.PagingToolbar({ pageSize: 50, store: ds_grid, displayInfo: true, displayMsg: 'Data Jadwal USM Dari {0} - {1} of {2}', emptyMsg: 'Jadwal USM Belum Dipilih.' }); var grid_nya = new Ext.grid.EditorGridPanel({ store: ds_grid, frame: true, //width: 1140, autoHeight: true, autoWidth: true, plugins: cari_data, id: 'grid_det_product', // autoWidth:true, // autoSizeColumns:true, // enableColumnResize: true, // enableColumnHide: false, // enableColumnMove: false, // enableHdMenu: false, // columnLines: true, // loadMask: true, buttonAlign: 'left', defaults: { anchor: '-10' }, forceFit: true, tbar: [{ text: 'Add', id: 'btn_add', iconCls: 'silk-add', handler: btn_menu_add }, '-', { text: 'Edit', id: 'btn_edit', iconCls: 'silk-edit', handler: function() { if (sm_nya.getCount() > 0) { var module_id = sm_nya.getSelected().data['idjadwalusm']; var stat_id = sm_nya.getSelected().data['idstatus']; f_jadwalusm_form(module_id, stat_id, ds_grid); } } }, '-', { text: 'Delete', id: 'btn_delete', iconCls: 'silk-delete', handler: function() { if (sm_nya.getCount() > 0) { var delete_id = sm_nya.getSelected().data['idjadwalusm']; Ext.MessageBox.show({ title: "Konfirmasi", msg: "Anda Yakin Untuk menghapus Data ini?", buttons: Ext.MessageBox.YESNO, fn: function(btn) { if (btn == 'yes') { Ext.Ajax.request({ url: BASE_URL + 'pendaftaran/c_jadwalusm/delete', method: 'POST', success: function() { Ext.MessageBox.alert("Informasi", "Hapus Data Berhasil"); ds_grid.load(); }, failure: function(result) { Ext.MessageBox.alert("Informasi", "Hapus Data Gagal"); }, params: { hapus_id: delete_id } }); } } }); } } }, '-', '->'], sm: sm_nya, vw: vw, autoScroll: true, cm: cm, bbar: paging, //autoExpandColumn: 'common', clicksToEdit: 1, listeners: { rowdblclick: function rowdblClick(grid, rowIdx) { var rec = ds_grid.getAt(rowIdx); //alert(rec.data["kdmenu"] + ', ' + Ext.getCmp('combox').getValue()); } } }); var form_bp_general = new Ext.form.FormPanel({ id: 'form_bp_general_id', title: 'Jadwal USM', region: 'center', autoScroll: true, buttonAlign: 'left', bodyStyle: 'padding: 5px', border: false, disabled: true, waitMsg: 'Waiting...', maskDisabled: false, monitorValid: true, items: [{ layout: 'form', border: false, items: [grid_nya] }] }); function btn_menu_add() { f_jadwalusm_form('', '',ds_grid); } get_content(form_bp_general); }