fieldset的getValues扩展方法
来源:互联网 发布:知乎电脑客户端下载 编辑:程序博客网 时间:2024/06/04 18:24
- 群里有个人问有没有像form的getValues方法,可惜没有,于是就动手扩展了一个。一下是扩展方法的代码
- Ext.override(Ext.form.FieldSet,
- {
- getValues: function (asString) {
- var self = this;
- var nform = document.createElement('form');
- document.appendChild(nform);
- nform.style.display = 'none';
- var fs = self.el.dom;
- nform.appendChild(fs.cloneNode(true));
- var fss = Ext.lib.Ajax.serializeForm(nform);
- document.removeChild(nform);
- if (asString) {
- return fss;
- }
- return Ext.urlDecode(fss);
- }
- });
使用例子:
- var form = new Ext.form.FieldSet({
- title: 'form',
- defaultType: 'textfield',
- labelAlign: 'right',
- labelWidth: 50,
- buttonAlign: 'center',
- frame: true,
- width: 220,
- items: [{
- fieldLabel: '文本框',
- name: 'field1',
- value: 45
- }, {
- fieldLabel: '文本框',
- name: 'field2',
- value: 12
- }],
- buttons: [{
- text: '按钮'
- }]
- });
- form.render("form");
- form.getValues();
0 0
- fieldset的getValues扩展方法
- fieldset的getValues扩展方法
- Extjs 给任何的容器组件增加 getValues方法
- Enum.GetValues 方法在 Silverlight 下实现
- sencha touch formPanel 和fieldSet 的setRecords方法
- extjs4 form getFieldValues 和 getValues 的区别
- fieldset的使用
- fieldset的用法
- fieldset的作用
- 控制fieldset的高度
- <fieldset>的样式
- fieldset
- html中的fieldset的用法
- html fieldset 的简单运用
- fieldset的样式和使用
- html 的fieldset and legend
- HTML中fieldset的使用
- HTML <fieldset> 标签的使用
- Ng机器学习系列补充:5、网页排名算法PageRank和文档排名算法DocRank
- Ruby实现http自动化测试(三)------Excel
- 转载:python的排序函数sort,sorted在列表排序和字典排序中的应用详解和举例 http://wangwei007.blog.51cto.com/68019/1100742
- mybatis中# ,$区别
- Android----输入模式设置
- fieldset的getValues扩展方法
- Android 圆形头像
- C语言各种文件操作
- Ubuntu,root下慎用chmod 664命令
- CSS样式命名之“逻辑块命名法”
- opencv学习系列(二)---颜色识别
- android官方侧滑菜单DrawerLayout详解
- Linux系统框架 构成
- 如何学习 COCOS2D-X ?