提交 68e057fd 编写于 作者: U unknown

修复某些情况下数据表格中的组件不能获取parentLine对象的问题

上级 79139241
......@@ -32,6 +32,13 @@
<td class="editTableTitle">{{$.lp.canSelectCount}}:</td>
<td class="editTableValue"><input title="0 表示不限制数量" type="text" name="count" value="text{$.count}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.showOptions}}:</td>
<td class="editTableValue">
<input type="radio" name="showOptions" value="input" text{($.showOptions)!="focus"?'checked':''}/>{{$.lp.onInput}}
<input type="radio" name="showOptions" value="focus" text{($.showOptions)=="focus"?'checked':''}/>{{$.lp.onFocus}}
</td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.options}}:</td>
<td class="editTableValue">
......
......@@ -32,6 +32,13 @@
<td class="editTableTitle">{{$.lp.canSelectCount}}:</td>
<td class="editTableValue"><input title="0 表示不限制数量" type="text" name="count" value="text{$.count}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.showOptions}}:</td>
<td class="editTableValue">
<input type="radio" name="showOptions" value="input" text{($.showOptions)!="focus"?'checked':''}/>{{$.lp.onInput}}
<input type="radio" name="showOptions" value="focus" text{($.showOptions)=="focus"?'checked':''}/>{{$.lp.onFocus}}
</td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.options}}:</td>
<td class="editTableValue">
......
......@@ -1043,7 +1043,10 @@ MWF.xApplication.process.FormDesigner.LP = {
"resizeVertical": "vertical",
"el_placement": "placement",
"popperClass": "Popper Class",
"triggerOnFocus": "trigger on focus"
"triggerOnFocus": "trigger on focus",
"showOptions": "Show Options",
"onInput": "When inputting",
"onFocus": "On Click"
},
"actionBar": {
"close":"Close",
......
......@@ -1050,8 +1050,10 @@ MWF.xApplication.process.FormDesigner.LP = {
"resizeVertical": "纵向",
"el_placement": "弹出位置",
"popperClass": "列表类名",
"triggerOnFocus": "激活即列出输入建议"
"triggerOnFocus": "激活即列出输入建议",
"showOptions": "显示选项",
"onInput": "输入时",
"onFocus": "点击时"
},
"actionBar": {
"close":"关闭",
......
......@@ -59,6 +59,23 @@ MWF.xApplication.process.Xform.$Module = MWF.APP$Module = new Class(
* var container = form.container; //获取表单容器
*/
this.form = form;
/**
* 当组件在数据表格或者数据模板中时,可以通过此属性获取所在行(条目)对象.
* @member {MWF.xApplication.process.Xform.Datatemplate.Line|MWF.xApplication.process.Xform.DatatablePC.Line|MWF.xApplication.process.Xform.DatatableMobile.Line}
* @example
* //获取组件所在数据模板/数据表格的行(条目)对象
* var line = this.form.get("fieldId").parentLine;
* //获取当前字段所在行下标
* var index = line.getIndex();
* //获取当前字段所在条目的subject字段的值
* var data = line.getModule("subject").getData();
* //设置当前字段所在条目的subject字段的值
* line.getModule("subject").setData("test1");
*/
this.parentLine = null;
},
_getSource: function(){
var parent = this.node.getParent();
......
......@@ -63,6 +63,7 @@ MWF.xApplication.process.Xform.Combox = MWF.APPCombox = new Class(
"count": this.json.count.toInt() || 0,
"splitStr": this.json.splitStr || ",\\s*|;\\s*|,\\s*|;\\s*",
"splitShow": this.json.splitShow || ", ",
"focusList": this.json.showOptions === "focus",
"list": this.getOptions(),
"onCommitInput": function(item){
this.fireEvent("commitInput");
......
......@@ -1356,9 +1356,12 @@ MWF.xApplication.process.Xform.DatatablePC.Line = new Class({
var hasData = this.data.hasOwnProperty(templateJsonId);
var module = this.form._loadModule(json, node, function () {});
module.parentLine = this;
module.parentDatatable = this.datatable;
var module = this.form._loadModule(json, node, function () {
this.parentLine = _self;
this.parentDatatable = _self.datatable;
});
if(!module.parentLine)module.parentLine = this;
if(!module.parentDatatable)module.parentDatatable = this.datatable;
if((json.type==="Attachment" || json.type==="AttachmentDg")){
module.addEvent("change", function(){
......@@ -1402,6 +1405,9 @@ MWF.xApplication.process.Xform.DatatablePC.Line = new Class({
}
}.bind(this));
},
getIndex: function(){
return this.options.index;
},
getModule: function(templateJsonId){
return this.all_templateId[templateJsonId];
},
......
......@@ -1070,9 +1070,12 @@ MWF.xApplication.process.Xform.Datatemplate.Line = new Class({
if (this.form.all[id]) this.form.all[id] = null;
if (this.form.forms[id])this.form.forms[id] = null;
var module = this.form._loadModule(json, node, function () {});
module.parentLine = this;
module.parentDatatemplate = this.template;
var module = this.form._loadModule(json, node, function () {
this.parentLine = _self;
this.parentDatatemplate = _self.template;
});
if(!module.parentLine)module.parentLine = this;
if(!module.parentDatatemplate)module.parentDatatemplate = this.template;
if( json.type==="Attachment" || json.type==="AttachmentDg" ){
module.addEvent("change", function(){
......@@ -1116,6 +1119,9 @@ MWF.xApplication.process.Xform.Datatemplate.Line = new Class({
module._setSubDatatemplateOuterEvents();
})
},
getIndex: function(){
return this.options.index;
},
getModule: function(templateJsonId){
return this.all_templateId[templateJsonId];
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册