http://blog.csdn.net/wjlht/article/details/6085245
使用extjs可以构造出下拉数,但是不方便向form提交参数,在此,笔者想到一个办法,很方便ComboBoxTree向form提交。
原理:
在form中增加一个隐藏的字段,当在comboBoxTree中选定值后自动在隐藏字段中赋值。
为实现此方法,需要重载comboBoxTree中collapse事件方法。
Ext.ux.ComboBoxTree = function(){
this.treeId = Ext.id()+'-tree';
this.maxHeight = arguments[0].maxHeight || arguments[0].height || this.maxHeight;
this.tpl = new Ext.Template('');
this.store = new Ext.data.SimpleStore({fields:[],data:[[]]});
this.selectedClass = '';
this.mode = 'local';
this.triggerAction = 'all';
this.onSelect = Ext.emptyFn;
this.editable = false;
this.selectNodeModel = arguments[0].selectNodeModel || 'exceptRoot';
Ext.ux.ComboBoxTree.sup