在Extjs中动态增加控件
2015-07-20 10:48
615 查看
Ext.onReady(function () { Ext.QuickTips.init(); Ext.form.Field.prototype.msgTarget = 'side'; var autoloadcontrol =new Ext.form.FieldSet({ layout: "column", title: "属性表单", }) var addForm = new Ext.FormPanel({ title: "<div align='center'>产品属性管理</div>", id: "addForm", name: "addForm", renderTo: Ext.getBody(), autoHeight: true, autoWidth: true, labelWidth: 80, frame: true, items: autoloadcontrol, bbar: [{ xtype: "button",text:"addform", listeners: { "click": function () { Ext.Ajax.request({ url: "/PropertyManage/ProductPropertyInfo.aspx", params: { op: "test" }, success: function (response) { //后台得到字符串 autoloadcontrol.add(eval(response.responseText)) autoloadcontrol.doLayout(); //用来刷新FormPanel }, }) } } }] }); });
protected void Page_Load(object sender, EventArgs e) { switch (Request["op"]) { case "test": Response.Write("new Ext.form.TextField({filedLabel:'标题',emptyText:'请输入内容',allowBlank:false,maxLength:50})"); Response.End(); break; } }
相关文章推荐
- Android布局的小窍门?
- Web布局连载——两栏固定布局(五)
- c#调用COM组件
- C#实现把指定数据写入串口
- extjs grid取到数据而不显示的解决
- C#中抽象方法与虚拟方法的区别
- c#中虚函数的相关使用方法
- C#实现多线程的同步方法实例分析
- C#中尾递归的使用、优化及编译器优化
- C#通用邮件发送类分享
- C#中this的用法集锦
- C#.NET获取拨号连接的宽带连接方法
- C#实现AddRange为数组添加多个元素的方法
- C#中Equality和Identity浅析
- C#生成饼形图及添加文字说明实例代码
- C#判等对象是否相等的方法汇总
- C#简单的向量用法实例教程
- C#实现基于链表的内存记事本实例
- C#托管堆对象实例包含内容分析
- C#实现按照指定长度在数字前补0方法小结