zoukankan      html  css  js  c++  java
  • 在Extjs中动态增加控件

      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;
                }
            }
    

      

  • 相关阅读:
    Jquery入门
    微服务
    数组
    流程控制
    GO的整型
    Go的巧记
    变量和常量
    Golang
    股票入市指南
    linux 命令行操作
  • 原文地址:https://www.cnblogs.com/anbylau2130/p/3631148.html
Copyright © 2011-2022 走看看