ext中的一些用法心得

CheckBoxAndRadio: function(){ 14. this.queryFieldForm = Ext.create("Ext.form.Panel",{ 15. id: 'checkBoxAndRadioForm' 16. ,name: 'checkBoxAndRadioForm' 17. ,margin: 1 18. ,region: 'north' 19. ,layout: "column" 20. ,tbar: [ 21. {xtype: 'button' 22. ,text: '输出多选数据' 23. ,id: 'outputCheckBox' 24. }, 25. '-', 26. {xtype : 'button', 27. text : '输出单选数据', 28. id : 'outputRadio' 29. }] 30. ,items:[ 31. {xtype:'checkboxgroup',name:'checkboxgroup', 32. id: 'checkboxgroup', fieldLabel: 'Two Columns',columnWidth:0.7, 33. items: [ 34. { boxLabel: 'Item 1', name: 'cb', inputValue: '1' }, 35. { boxLabel: 'Item 2', name: 'cb', inputValue: '2' }, 36. { boxLabel: 'Item 3', name: 'cb', inputValue: '3' }, 37. { boxLabel: 'Item 4', name: 'cb', inputValue: '4' }, 38. { boxLabel: 'Item 5', name: 'cb', inputValue: '5' }, 39. { boxLabel: 'Item 6', name: 'cb', inputValue: '6' } 40. ]} 41. ,{xtype:'radiogroup', name:'radiogroup', fieldLabel:'radios', 42. columnWidth:0.7,items: [ 43. { boxLabel: 'Item 1', name: 'rb', inputValue: '1' ,id: 'radiogroup'}, 44. { boxLabel: 'Item 2', name: 'rb', inputValue: '2' }, 45. { boxLabel: 'Item 3', name: 'rb', inputValue: '3' }, 46. { boxLabel: 'Item 4', name: 'rb', inputValue: '4' }, 47. { boxLabel: 'Item 5', name: 'rb', inputValue: '5' }, 48. { boxLabel: 'Item 6', name: 'rb', inputValue: '6' } 49. ]} 50. ] 51. }); viewConfig : { listeners : { scope : this, itemclick : function(view, record, item, index, e) { //双击事件~~~~alert(123);} }},原文出处:http://blog.csdn.net/zhangzhida163/article/details/7225005itemclick(Ext.view.View this, Ext.data.Model record, HTMLElement item, Number index, Ext.EventObject e ) //鼠标的单击事件itemcontextmenu(Ext.view.View this, Ext.data.Model record, HTMLElement item, Number index, Ext.EventObject e ) //鼠标的右键事件itemdblclick(Ext.view.View this, Ext.data.Model record, HTMLElement item, Number index, Ext.EventObject e ) //鼠标的双击事件itemmousedown(Ext.view.View this, Ext.data.Model record, HTMLElement item, Number index, Ext.EventObject e ) itemmouseenter(Ext.view.View this, Ext.data.Model record, HTMLElement item, Number index, Ext.EventObject e )itemmouseleave(Ext.view.View this, Ext.data.Model record, HTMLElement item, Number index, Ext.EventObject e )itemmouseup(Ext.view.View this, Ext.data.Model record, HTMLElement item, Number index, Ext.EventObject e )添加时间的方法1.创建grid时添加var grid = Ext.create('Ext.grid.Panel', {renderto: Ext.getBody(), frame : true,store : store,layout : {type : 'hbox',align : 'stretch'},width : 500,heigh : 100,columns : [ {header : '名称',flex : 1,sortable : true,dataIndex : 'NAME'}, {header : '路径',flex : 1,sortable : true,dataIndex : 'PATH',hidden : true}, {header : '操作',flex : 1,sortable : true,dataIndex : 'ACTION'} ],listeners:{ 'itemclick':function(view,record,item,index,e){}},viewConfig : {forceFit : true,scrollOffset : 0}});2.后续添加grid.addListener('itemclick',click,this);function click(view,record,item,index,e){if (typeof (record.raw) != 'undefined') { name= record.raw.NAME; //获取单击行的相应数据 path= record.raw.PATH; num = index;}}combo 的用法// 获取combox ID值var securityTypeIDValue = Ext.getCmp('securityTypeCombo').getValue(); // 获取显示值var securityTypeDisValue = Ext.getCmp('securityTypeCombo').getRawValue(); // Combox定义/***************************Combox start*******************************/var securityTypeRecord=[ {name : 'SAVE_VALUE',type : 'string'}, {name : 'DISPLAY_VALUE',type : 'string'} ]; var securityTypeRecordHeads = Ext.data.Record.create(securityTypeRecord); var securityTypeDatastore = new Ext.data.Store( { proxy:new Ext.data.HttpProxy(new Ext.data.Connection({timeout:0,url:'/customize/control/getZhengShangsecurityType'})), reader : new Ext.data.JsonReader( { root : 'root' }, securityTypeRecordHeads), remoteSort : false }); securityTypeDatastore.load();var securityTypeCombo = new Ext.form.ComboBox({id:'securityTypeCombo',width:110,forceSelection : true, selectOnFocus: true, triggerAction: 'all', mode: 'local', store: securityTypeDatastore, allowBlank: true, valueField : 'SAVE_VALUE', displayField : 'DISPLAY_VALUE',emptyText:'---请选择---'});/***************************Combox end *******************************/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值