- 浏览: 234277 次
- 性别:
- 来自: 广州
文章分类
最新评论
-
q459997705:
写的很好,对我很有用
java 连接paradox数据库的几种方式 -
raisun_1988:
还不会用啊
扩展GridPanel,附带分页选中状态,实现快速构建一个功能齐全的Grid -
海阔天空shen:
貌似不行吧 一直loading
查看ext的api文档 -
fxn19870827:
好像是不行啊
jsp解决图片缓存问题 -
songs_0319:
没有用 ,在firefox里面还是乱码
设置EXT提交数据的编码
在网上搜了两棵下拉树,均有一些小问题,用不了,于是自己参考它们做了一棵下拉树,
代码如下:
代码如下:
/** * 下拉树ComboBoxTree * @extend Ext.form.ComboBox * @xtype 'combotree' * * @author chengbao_zhu */ /** * ---------------------- * Demo ComboBoxTree * ---------------------- */ /*-------------------------------------------------* treecombo = { fieldLabel : '片 源 类 别', width : 127, xtype : 'combotree', passName : 'videoCategory', allowUnLeafClick : false, treeHeight:200, tree : new Ext.tree.TreePanel({ rootVisible : false, root : new Ext.tree.AsyncTreeNode({ id : 'CategoryRoot', text : "影片分类", expanded : true, loader : new Ext.tree.TreeLoader({ dataUrl : UrlPpts.ajax.vdocategory + '?method=tree' }) }) }), allowBlank : false } *-----------------------------------------------------*/ ComboBoxTree = Ext.extend(Ext.form.ComboBox, { /** * ------------------------------------- * 作为隐藏域的name属性 * ------------------------------------- */ passName : 'id', /** * ------------------------------------- * 是否允许非叶子结点的单击事件 * * @default false * ------------------------------------- */ allowUnLeafClick : true, /** * --------------------- * 树渲染的模板tpl * --------------------- */ // tpl: '<div id="treeTpl"></div>', //html代码 /** * ----------------------- * 树显示的高度,默认为180 * ----------------------- */ treeHeight : 180, store : new Ext.data.SimpleStore({ fields : [], data : [[]] }), //Default editable : false, // 禁止手写及联想功能 mode : 'local', triggerAction : 'all', maxHeight : 500, selectedClass : '', onSelect : Ext.emptyFn, emptyText : '请选择...', /** * 清空值 */ clearValue : function() { if (this.passField) { this.passField.value = ''; } this.setRawValue(''); }, /** * 设置传值 * @param passvalue */ setPassValue: function(passvalue){ if (this.passField) this.passField.value = passvalue; }, /** * -------------------------------------- * 下拉树被点击事件添加一处理方法 * @param node * -------------------------------------- */ onTreeSelected : function(node) { }, /** * ---------------------------------- * 树的单击事件处理 * @param node,event * ---------------------------------- */ treeClk : function(node, e) { if (!node.isLeaf() && !this.allowUnLeafClick) { e.stopEvent();// 非叶子节点则不触发 return; } this.setValue(node.text);// 设置option值 this.collapse();// 隐藏option列表 if (this.passField) this.passField.value = node.id;// 以树的节点ID传递 // 选中树节点后的触发事件 this.fireEvent('treeselected', node); }, /** * 初始化 * Init */ initComponent : function() { ComboBoxTree.superclass.initComponent.call(this); this.tree.autoScroll = true; this.tree.height = this.treeHeight; this.tree.containerScroll = false; this.tplId = Ext.id(); // overflow:auto" this.tpl = '<div id="' + this.tplId + '" style="' + this.treeHeight + '";overflow:hidden;"></div>'; /** * ----------------------- * 添加treeselected事件, * 选中树节点会激发这个事 * 件, 参数为树的节点 * ------------------------ */ this.addEvents('treeselected'); // this.on('treeselected',this.onTreeSelected,this); }, /** * ------------------ * 事件监听器 * Listener * ------------------ */ listeners : { 'expand' : { fn : function() { if (!this.tree.rendered && this.tplId) { this.tree.render(this.tplId); } this.tree.show(); }, single : true }, 'render' : { fn : function() { this.tree.on('click', this.treeClk, this); /** * ------------------------------------------- * 创建隐藏输入域<input /> * 并将其dom传给passField * ------------------------------------------ */ if (this.passName) { this.passField = this.getEl().insertSibling({ tag : 'input', type : 'hidden', name : this.passName, id : this.passId || Ext.id() }, 'before', true) } this.passField.value = this.passValue !== undefined ? this.passValue : (this.value !== undefined ? this.value : ''); this.el.dom.removeAttribute('name'); } }, 'beforedestroy' : { fn : function(cmp) { this.purgeListeners(); this.tree.purgeListeners(); } } } }); /** * --------------------------------- * 将ComboBoxTree注册为Ext的组件,以便使用 * Ext的延迟渲染机制,xtype:'combotree' * --------------------------------- */ Ext.reg('combotree', ComboBoxTree);
评论
1 楼
fengbingji
2009-07-08
我在formpanel上面使用combotree时,如何绑定combotree的值呢(即form load之后如何给combotree赋值)?
发表评论
-
EXT CHANGELOG
2010-04-02 10:29 9913.2http://www.extjs.com/produc ... -
给Ext.Toolbar加上remove方法以移除子组件
2010-02-08 10:02 2643在用Ext.Toolbar的时候,发现竟然没有remove方法 ... -
ext panel屏蔽右键菜单
2010-01-11 14:46 1997panel.on('render',function(){ ... -
extjs htmleditor readOnly无效解决方法
2010-01-07 13:03 2491Ext 里的Ext.form.HtmlEditor里readO ... -
ext TabPanel相关
2009-04-24 12:11 2073在使用Ext.TabPanel时,经常会用到tabchang ... -
extjs GridPanel 相关
2009-04-16 16:41 1989var hmenu = this.grid.getView() ... -
extjs store 相关
2009-04-16 16:39 1197Method filterBy(fn,scope)过虑记录时 ... -
遍历ext form表单的递归方法
2009-04-10 10:54 2105function eachItem(item,inde ... -
javascript 闭包
2009-03-26 20:40 866elf8848 写道 function outer ... -
extjs - 树
2009-03-12 17:55 1787<1>重新load单一树节点(node) t ... -
查看ext的api文档
2008-12-29 22:36 2306找到这个localXHR.js(附件里有这个文件)复制到doc ... -
设置EXT提交数据的编码
2008-10-27 10:35 1312对于提交中出现的乱码,在Ext中可以修改Request Hea ... -
扩展combobox的下拉Grid
2008-09-17 12:45 3839/** * 下拉ComboBoxGrid * ... -
Ext Js 给window或panel加上热键
2008-08-21 14:25 2426如题,代码如下: var OverTimeForm = n ... -
ext 图片预览事件触发以及IE7下预览图片
2008-08-21 14:11 3001首先在FormPanel里添加图片预览区以及图片选择组件 ... -
Ext.Panel API翻译
2008-07-22 11:17 2912Ext.Panel API翻译 引用网 ... -
ExtJs 的一些技巧与问题
2008-07-15 13:36 3798[color=white] [list=1] 修改 ... -
ExtJs 委托与回调(createDelegate && createCallback)
2008-07-15 12:44 2021author=Ext Community(译者:[http:/ ... -
扩展GridPanel,附带分页选中状态,实现快速构建一个功能齐全的Grid
2008-06-06 14:26 4552使用简单的配置就可以实现 store, columns, se ... -
ExtJs 上传控件change事件触发解决方法
2008-06-06 14:18 9385在 Ext 中,上传控件的ch ...
相关推荐
Extjs4下拉树菜单 ComboBoxTree 支持单选和多选并且支持展开选中指定节点的通用控件 在项目中已经成熟运用 值得收藏和运用
extjs下拉树,在网上找了很多,发现bug实在让人头大,干脆自己写了个下拉树组件,功能全面
[Ext 3.x + Ext 2.x] 下拉树 Ext.ux.ComboBoxTree
Extjs4 comboboxTree下拉树型菜单,完美支持多选、单选,绝对好用。来源于网络,稍作修改。
网上的一个silverlight的树形下拉控件,改成wpf使用的了,希望对各位有所帮助。
WPF的下拉选择树,直接可以使用,压缩包资源包含源码。提供简单风格,ItemsSource、SelectedItem支持双向绑定,文本显示有两种模式(通过IsSimpleDisplayValue属性设置)。可通过给SelectedItem赋值自动展开并选中树...
使用ext4.0开发 下拉树的实现,代码 找了好久 现在存下来
用Div和TreeView模拟的下拉框树. 并解决了Select总在最顶端的问题,即下拉框中的树不被Select控件遮盖 用c# + asp.net 2.0实现 ComboBoxTreeCtrl.ascx为自定义下拉树控件 Default.aspx为例子页面
功能:extjs4 下拉菜单树 combobox+tree 支持单选多选等 收集两款,仅需要1分。
带复选框的这是经过测试可以用的下拉树
目前公司项目用的 ext 6.5 的 前台框架,在开发过程当中需要使用 到下拉树组件 ext原生并未提供此组件,网上的大部分都不能使用,于是乎自己根据需要手动进行封装,有需要的同学可进行下载.
C#源代码,在下拉组合框(ComboBox)中显示树视图(TreeView)
摘要:C#源码,控件类库,treeview,combobox,自定义控件 C# wpf combobox带treeview的自定义控件示例源码,树控菜单和下拉框的自定义源码,希望对你有所帮助。 运行环境:Visual Studio2010