zoukankan      html  css  js  c++  java
  • 在Extjs中创建构造函数

    由于Extjs的函数内部中没有智能提示,函数中有哪些字段以及字段的意义我们必须要通过网上查找才能得知,这对于我们开发来说是一个很不方便的事。用过了Visual Studio 2008,我们都对它的智能提示产生了依赖!当输入函数名和一个‘(’,系统便会自动找到该函数,然后给出提示。我们也希望在Extjs中能有这种功能,下面就是文本框例子的具体实现:

    myExtjs.Ext.TextField = Ext.extend(Ext.form.TextField, {
    
        constructor: function(configOrName, fieldLabel, width, inputType, emptyText, readOnly) {
    /// <summary>
    /// 文本框构造函数
    /// </summary>
    /// <param name="configOrName">配置或名称</param>
    /// <param name="fieldLabel">String 标签</param>
    /// <param name="width">Number 宽度</param>
    /// <param name="inputType">String 类型,例如:radio, text, password, file(默认是'text')</param>
    /// <param name="emptyText">String 文本框为空时文本框内显示的内容</param>
    /// <param name="readOnly">Bool 是否为只读</param>
            var config = {};
            if (typeof (configOrName) == "object") {
                config = configOrName;
            }
            else {
                if (configOrName) {
                    config['name'] = configOrName;
                }
            }
            if (fieldLabel) {
                config['fieldLabel'] = fieldLabel;
            }
            if (width) {
                config['width'] = width;
            }
            if (inputType) {
                config['inputType'] = inputType;
            }
            if (emptyText) {
                config['emptyText'] = emptyText;
            }
            if (readOnly) {
                config['readOnly'] = readOnly;
            }
    
            Suucha.Ext.TextField.superclass.constructor.call(this, config);
        }
    });
  • 相关阅读:
    docker 镜像相关
    docker相关网站
    docker初识 一
    loadrunner Windows资源指标
    Codeforces Round #368 (Div. 2) Brain's Photos
    CodeForce 589J Cleaner Robot
    CodeForce 677I Lottery
    CodeForce 677D Boulevard
    CodeForce 589B Layer Cake
    Map的遍历
  • 原文地址:https://www.cnblogs.com/cdts_change/p/1562877.html
Copyright © 2011-2022 走看看