| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- /**
- * Created by zhouy on 2018/10/18.
- */
- Ext.define('KitchenSink.view.binding.ChildForm', {
- extend: 'Ext.window.Window',
- xtype: 'document-kind-childwin',
- layout: 'fit',
- modal: true,
- width: 400,
- height: 220,
- listeners:{
- show:function(w){
- if(w.record){
- w.down('form').loadRecord(w.record);
- }
- }
- },
- initComponent:function(){
- var me=this;
- Ext.apply(me,{
- items:me.setFormItems()
- });
- me.callParent();
- },
- etc:{
- customerkind:{
- items:[{
- xtype:'hidden',
- name:'ck_id'
- },{
- xtype:'textfield',
- name:'ck_kind',
- allowBlank:false,
- fieldLabel:'类型'
- }],
- keyField:'ck_id',
- saveUrl:''
- },
- vendorkind:{
- items:[{
- xtype:'hidden',
- name:'vk_id'
- },{
- xtype:'textfield',
- name:'vk_kind',
- allowBlank:false,
- fieldLabel:'类型'
- }],
- },
- productkind:{
- items:[{
- xtype:'hidden',
- name:'pk_id'
- },{
- xtype:'textfield',
- name:'pk_kind',
- allowBlank:false,
- fieldLabel:'类型'
- }],
- },
- inoutkind:{
- }
- },
- setFormItems:function() {
- var me = this, kind = me.dataKind;
- var conf = {
- xtype: 'form',
- bodyPadding: 10,
- border: false,
- modelValidation: true,
- layout: {
- type: 'vbox',
- align: 'stretch'
- },
- defaults: {
- xtype: 'textfield'
- },
- buttons: [{
- text: '保存',
- formBind:true,
- handler: me.onSave,
- scope:me
- }, {
- text: '取消',
- handler: me.onCancel,
- scope:me
- }]
- };
- return Ext.apply(conf, me.etc[kind]);
- },
- onSave:function(){
- var form=this.down('form');
- alert('save');
- },
- onCancel:function(){
- alert('cancel');
- this.hide();
- }
- });
|