提交 7addd036 编写于 作者: U unknown

selecto、radio、chexkbox增加getText的api方法

上级 a037ce94
......@@ -363,6 +363,20 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class(
if (!text.length) text = [""];
return {"value": value, "text": text};
},
/**
* @summary 获取选中项的text,如果未选中返回空数组。
* @return {Array} 返回选中项的text数组
* @example
* var array = this.form.get('fieldId').getText(); //获取选中项的数组
*/
getText: function(){
var texts = this.getTextData().text;
if( texts && texts.length === 1 ){
return texts[0] ? texts : [];
}else{
return (texts && texts.length) ? texts : [];
}
},
//getData: function(){
//var inputs = this.node.getElements("input");
//var value = [];
......
......@@ -404,6 +404,16 @@ MWF.xApplication.process.Xform.Radio = MWF.APPRadio = new Class(
}
return {"value": [value] || "", "text": [text || value || ""]};
},
/**
* @summary 获取选中项的text。
* @return {String} 返回选中项的text
* @example
* var text = this.form.get('fieldId').getText(); //获取选中项的文本
*/
getText: function(){
var texts = this.getTextData().text;
return (texts && texts.length) ? texts[0] : "";
},
getInputData: function(){
if (this.isReadonly()){
return this._getBusinessData();
......
......@@ -418,6 +418,16 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect = new Class(
if (!text.length) text = [""];
return {"value": value, "text": text};
},
/**
* @summary 获取选中项的text。
* @return {String} 返回选中项的text
* @example
* var text = this.form.get('fieldId').getText(); //获取选中项的文本
*/
getText: function(){
var texts = this.getTextData().text;
return (texts && texts.length) ? texts[0] : "";
},
getInputData: function(){
if( this.isReadonly()){
return this._getBusinessData();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册