OpenGL

1 引进ext包

   1) 首先从网站上下载extjs包。

   2)在html中引入

    <link rel="stylesheet" type="text/css" href="../extjs/resources/css/ext-all.css" />
    <script type="text/javascript" src="../extjs/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="../extjs/ext-all-debug.js"></script>

    <link rel="stylesheet" type="text/css" href="../extjs/examples.css" />

  3)在body中加入

     <div id="dr">

  4)执行脚本。

 

2 EXT表单

 Ext.onReady(function(){

    Ext.QuickTips.init();

    // turn on validation errors beside the field globally
    Ext.form.Field.prototype.msgTarget = 'side';

    var bd = Ext.getBody();

  /*
   * ================  Date Range  =======================
   */
   
    var dr = new Ext.FormPanel({
      id:'FormPanel',
      labelWidth: 125,
      frame: true,
      title: 'Date Range',
      bodyStyle:'padding:5px 5px 0',
     width: 350,
      defaults: {width: 175},
      defaultType: 'datefield',// 默认日期格式
      items: [{
        fieldLabel: 'user',
        name: 'user',
        id: 'user',
        xtype: 'textfield', //表示类型为输入框
        readOnly : true //当readonly 为true时出入框不可编辑
        
      },{
        fieldLabel: 'userpwd',
        name: 'userpwd',
        id: 'userpwd',
        xtype: 'textfield',//表示类型为出入
        inputType:'password'
      },{
        fieldLabel: 'Start Date',
        name: 'startdt',
        id: 'startdt',
        vtype: 'daterange',
        endDateField: 'enddt' // id of the end date field
      },{
        fieldLabel: 'End Date',
        name: 'enddt',
        id: 'enddt',
        vtype: 'daterange',
        startDateField: 'startdt' // id of the start date field
      }]
    });

    dr.render('dr');

 //Ext.getCmp("FormPanel").form.findField('user').getEl().dom.readOnly = true;
   
    /*
     * ================  Password Verification ======================= var pwd = new Ext.FormPanel({
      labelWidth: 125,
      frame: true,
      title: 'Password Verification',
      bodyStyle:'padding:5px 5px 0',
      width: 350,
      defaults: {
        width: 175,
        inputType: 'password'
      },
      defaultType: 'textfield',
      items: [{
        fieldLabel: 'Password',
        name: 'pass',
        id: 'pass'
      },{
        fieldLabel: 'Confirm Password',
        name: 'pass-cfrm',
        vtype: 'password',
        initialPassField: 'pass' // id of the initial password field
      }]
    });

    pwd.render('pw');


     */
       
  
});

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值