function pBdnhukum(id_module,ds) { var form_back = new Ext.form.FormPanel({ border: false, id: 'form_back', labelAlign: 'left', buttonAlign: 'right', bodyStyle: 'padding:10px 3px 3px 5px', // atas, kanan, bawah, kiri monitorValid: true, height: 150, width: 400, layout: 'form', items: [] }); var form_bp_general = new Ext.form.FormPanel({ border: false, id: 'form_bp_general', labelWidth: 200, labelAlign: 'right', buttonAlign: 'right', bodyStyle: 'padding:10px 3px 3px 5px', // atas, kanan, bawah, kiri monitorValid: true, height: 500, width: 650, layout: 'form', autoScroll: true, reader: new Ext.data.JsonReader ({ root: 'data', totalProperty: 'results', id: 'id', fields: [ { name: "kdbadanhukum", mapping: "kdbadanhukum" },{ name: "nmbadanhukum", mapping: "nmbadanhukum" },{ name: "alamat1", mapping: "alamat1" },{ name: "alamat2", mapping: "alamat2" },{ name: "kota", mapping: "kota" },{ name: "kdpos", mapping: "kdpos" },{ name: "notelp", mapping: "notelp" },{ name: "nofax", mapping: "nofax" },{ name: "tglakta", mapping: "tglakta" },{ name: "nmakta", mapping: "nmakta" },{ name: "tglpengesahan", mapping: "tglpengesahan" },{ name: "nopengesahan", mapping: "nopengesahan" },{ name: "email", mapping: "email" },{ name: "pass", mapping: "pass" },{ name: "website", mapping: "website" },{ name: "tglberdiri", mapping: "tglberdiri" } ] }), items: [ { xtype: 'textfield', id: 'idkdbadanhukum', fieldLabel: 'Kode', width: 250, allowBlank: false, name: "kdbadanhukum" }, { xtype: 'textfield', id: 'idnmbadanhukum', fieldLabel: 'Nama Badan Hukum', width: 250, allowBlank: false, name: "nmbadanhukum" }, { xtype: 'textfield', id: 'idalamat1', fieldLabel: 'Alamat 1', width: 300, allowBlank: false, name: "alamat1" }, { xtype: 'textfield', id: 'idalamat2', fieldLabel: 'Alamat 2', width: 300, allowBlank: false, name: "alamat2" }, { xtype: 'textfield', id: 'idkota', fieldLabel: 'Kota', width: 250, allowBlank: false, name: "kota" }, { xtype: 'textfield', id: 'idkdpos', fieldLabel: 'Kode Pos', width: 250, allowBlank: false, name: "kdpos" }, { xtype: 'textfield', id: 'idnotelp', fieldLabel: 'No.Tlp', width: 250, allowBlank: false, name: "notelp" }, { xtype: 'textfield', id: 'idnofax', fieldLabel: 'No.Fax', width: 250, allowBlank: false, name: "nofax" }, { xtype: 'datefield', id: 'idtglakta', fieldLabel: 'Tgl.Akta', width: 100, allowBlank: false, name: "tglakta" }, { xtype: 'textfield', id: 'idnmakta', fieldLabel: 'Nama Akta', width: 250, allowBlank: false, name: "nmakta" }, { xtype: 'datefield', id: 'idtglpengesahan', fieldLabel: 'Tgl.Pengesahan', width: 100, allowBlank: false, name: "tglpengesahan" }, { xtype: 'textfield', id: 'idnopengesahan', fieldLabel: 'No.Pengesahan', width: 250, allowBlank: false, name: "nopengesahan" }, { xtype: 'textfield', vtype:'email', id: 'idemail', fieldLabel: 'Email', width: 250, allowBlank: false, name: "email" }, { xtype: 'textfield', inputType: 'password', id: 'idpass', fieldLabel: 'Password Email', width: 250, allowBlank: false, name: "pass" }, { xtype: 'textfield', id: 'idwebsite', fieldLabel: 'website', width: 250, allowBlank: false, name: "website" }, { xtype: 'datefield', id: 'idtglberdiri', fieldLabel: 'Tgl.Berdiri', width: 100, allowBlank: false, name: "tglberdiri" } ], buttons: [{ id:'btn_simpan', iconCls: 'silk-save', text: 'Simpan', handler: function() { simpan_grid('form_bp_general'); } }, { text: 'Kembali', handler: function() { win.close(); } }], listeners:{ afterrender: module_afterrender } }); function module_afterrender(){ if(id_module!=""){ form_bp_general.getForm().load({ url : BASE_URL + 'bdnhukum_controller/grid', params:{ id_module:id_module }, success: function(form, action){ }, failure: function(form, action){ Ext.MessageBox.alert('Failure', 'Fail to get data'); } //waitMsg:'Loading..' }); } //Ext.getCmp('daritgl').setValue(SYS_DATE); //Ext.getCmp('sampaitgl').setValue(SYS_DATE); } function simpan_grid(namaForm) { var form_nya = Ext.getCmp(namaForm); form_nya.getForm().submit({ url: BASE_URL + 'bdnhukum_controller/update', method: 'POST', params:{ // mslider:Ext.getCmp('slideratas').getValue(), // pengguna:USERNAME }, success: function() { Ext.MessageBox.alert("Informasi", "Simpan Data Berhasil"); //ds.load(); form_bp_general.getForm().load(); //Ext.getCmp('form_bp_general').enable(); //Ext.getCmp('btn_simpan').enable(); // Ext.getCmp('btn_hapus').disable(); // Ext.getCmp('btn_ubah').disable(); }, failure: function() { Ext.MessageBox.alert("Informasi", "Simpan Data Gagal"); } }); } /* function reset(namaForm) { var form_nya = Ext.getCmp(namaForm); form_nya.getForm().reset(); } */ SET_PAGE_CONTENT(form_back); var win = new Ext.Window({ title: 'Badan Hukum', modal: true, items: [form_bp_general], resizable: false, draggable: false, }).show(); }