Ext基础知识

来源:互联网 发布:mett微表情训练软件 编辑:程序博客网 时间:2024/05/22 22:08

PathSet.form.parentMenuTree.fieldLabel = "路径库信息";          //动态修改对象的属性信息。直接找到该对象.属性 = "修改的值";

 

 

//关闭tabPanel时,添加一个提示信息

listeners : {

beforeremove : function(container, comp) {

if (comp.confirmed)

return;

var self = this;

Ext.Msg.confirm('提示', '关闭标签前请先保存您的数据,您确定要关闭?', function(answer) {

if (answer == 'yes') {

comp.confirmed = true;

container.remove(comp, true);

}

})

return false;

}

},

 

 

 

SearchFaq.data.form.findByType("textfield")[0].setValue(a);////给高级搜索的form中的问题传值"textfield"表示类型,"[0]"表示第一个textfield,setValue()为设置值

 

 

 

 

 

//定义一个下拉菜单的信息

var confInfo = new Ext.form.ComboBox( {

id : 'confInfoId',

name : 'confInfoName',

hiddenName : 'confInfo',                 //通过form提交时得到配置的id的值,得到id,此属性必须设置,否则取得值为value

fieldLabel : '选择配置',

displayField : 'text',

valueField : 'id',

mode : 'local',

editable : false,

typeAhead : true,

loadMask : true,

emptyText : '选择配置信息',

allowBlank : false,

selectOnFocus : false,

triggerAction : 'all',

width : 100,

store : new Ext.data.SimpleStore( {

fields : [ "id", "text" ],

data : [ [ "setrules", "规则配置" ], [ "setnodes", "节点配置" ] ]

})

 

});

 

//定义个set集合

var fieldSet = new Ext.form.FieldSet({

collapsible: true,

        autoHeight:true,

        autoWeight:true,

        defaults:{

width:350,

labelWidth:100

},

items:[

      { xtype:'fieldset',

           title: '',

           autoHeight:true,

           items :[confInfo,{

               name: 'uploadFile',

               xtype:'textfield',

               fieldLabel: '文件',

inputType: 'file',

anchor:'96%'

           }]

      }

       

      ]

});

 

// 定义个formPanel,把set信息添加此中

var confFormPanel = new Ext.FormPanel( {

region : 'center',

layout : 'fit',

frame : false,

enctype : 'multipart/form-data',

bodyStyle : 'padding:5px 5px 0',

width : 350,

fileUpload: true,   //要提交上传信息时,必须标明此属性

 

//提交form对象

confFormPanel.getForm().submit({

   url : postUrl,

   success : function() {

  alert("成功")

  configWindow.hide();

   },

   failure : function() {

  Ext.Msg.alert('', '提交失败');

  Ext.getCmp("sub_button").setDisabled(false);

   }

   });

原创粉丝点击