ext NumberField 基本屬性注釋

2021-08-31 12:51:46 字數 2446 閱讀 8007

/*

* ext js library 1.1.1

* [email protected]

* *

*//**

* @class ext.form.numberfield

* @extends ext.form.textfield

* 數字型文字域,提供自動鍵擊過濾和數字校驗。

* @constructor

* 建立乙個新的numberfield物件

* @param config 配置選項

*/ext.form.numberfield = function(config);

ext.extend(ext.form.numberfield, ext.form.textfield, fieldclass 設定該域的css,預設為x-form-field x-form-num-field

*/fieldclass: "x-form-field x-form-num-field",

/*** @cfg allowdecimals 值為 false時將不接受十進位制值 (預設為true)

*/allowdecimals : true,

/*** @cfg decimalseparator 設定十進位制數分割符(預設為 '.')(??指的大概是小數點)

*/decimalseparator : ".",

/*** @cfg decimalprecision 設定小數點後最大精確位數(預設為 2)

*/decimalprecision : 2,

/*** @cfg allownegative 值為 false時只允許為正數 (預設為 true,即預設允許為負數)

*/allownegative : true,

/*** @cfg minvalue 允許的最小值 (預設為 number.negative_infinity)

*/minvalue : number.negative_infinity,

/*** @cfg maxvalue 允許的最大值 (預設為number.max_value)

*/maxvalue : number.max_value,

/*** @cfg mintext 最小值驗證失敗(ps:超出設定的最小值範圍)時顯示該錯誤資訊(預設為"the minimum value for this field is ")

*/mintext : "the minimum value for this field is ",

/*** @cfg maxtext 最大值驗證失敗(ps:超出設定的最大值範圍)時顯示該錯誤資訊(預設為 "the maximum value for this field is ")

*/maxtext : "the maximum value for this field is ",

/*** @cfg nantext 當值非數字時顯示此錯誤資訊。例如,如果僅僅合法字元如'.' 或 '-'而沒有其他任何數字出現在該域時,會顯示該錯誤資訊。(預設為" is not a valid number")

*/nantext : " is not a valid number",

// private

initevents : function()

if(this.allownegative)

this.stripcharsre = new regexp('[^'+allowed+']', 'gi');

var keypress = function(e)

var c = e.getcharcode();

if(allowed.indexof(string.fromcharcode(c)) === -1)

};this.el.on("keypress", keypress, this);

},// private

validatevalue : function(value)

if(value.length < 1)

var num = this.parsevalue(value);

if(isnan(num))

if(num < this.minvalue)

if(num > this.maxvalue)

return true;

},getvalue : function(),

// private

parsevalue : function(value),

// private

fixprecision : function(value)

return parsefloat(value).tofixed(this.decimalprecision);

},setvalue : function(v),

// private

decimalprecisionfcn : function(v),

beforeblur : function()

}});

ext numberfield新增金額輸入效果

if ext.form.numberfield if this.formatcomma if this.allownegative this.stripcharsre new regexp allowed gi var keypress function e var c e.getcharcode ...

Optimized Purchasing基礎知識

pr的三要素 物料 數量 採購日期 日期是會影響價錢的 blanket po fo框架訂單。a 成本中心,i 限制 專案的限制標籤 miro支票不管數量,從帳戶分配輸入金額。產生pr三種 me51n,me25,mrp 產生po四種 me21n,me25,me57,me59n evo 物料管理 採購 ...

Phabricator Arcanist基本用法

git clone git git clone git 獲取到arcanist的原始碼後,進行相關配置 開啟.bash profile open e bash profile在環境變數中新增 export path path somewhere arcanist bin 命令列中輸入arc命令檢視是...