Permalink
Browse files

fix: 多语组件与datatable关联打通

  • Loading branch information...
1 parent 2dded5b commit a6a8e9aa7687cf4f3e9683e3462b55de8243001c liuyk committed Dec 27, 2016
Showing with 12 additions and 5 deletions.
  1. +12 −5 js/component/keroa-multilang.js
@@ -38,18 +38,25 @@ var MultilangAdapter = BaseAdapter.extend({
var multidata = [];
this.field = this.options.field;
- // 创建组件 - 此处不加el?
-
-
+ if (parseInt(this.options.rowIndex) > -1) {
+ if ((this.options.rowIndex + '').indexOf('.') > 0) {
+ // 主子表的情况
+ var childObj = ValueMixin.methods.getChildVariable.call(this);
+ var lastRow = childObj.lastRow;
+ var lastField = childObj.lastField;
+ this.field = lastField;
+ }
+ }
+ // 创建组件 - 此处不加el?
+ this.comp = new Multilang({el:this.element,"multinfo":multinfo,"field":this.field});
if (parseInt(this.options.rowIndex) > -1) {
if ((this.options.rowIndex + '').indexOf('.') > 0) {
// 主子表的情况
var childObj = ValueMixin.methods.getChildVariable.call(this);
var lastRow = childObj.lastRow;
var lastField = childObj.lastField;
- this.field = lastField;
this.dataModel.on(DataTable.ON_VALUE_CHANGE, function (opt) {
var id = opt.rowId;
@@ -183,7 +190,7 @@ var MultilangAdapter = BaseAdapter.extend({
// if (rowObj) {
// this.modelValueChange(rowObj.getValue(this.field));
// }
- this.comp = new Multilang({el:this.element,"multinfo":multinfo,"field":this.field});
+
// UI传值到datatable
this.comp.on('change.u.multilang', function(object){
self.slice = true;

0 comments on commit a6a8e9a

Please sign in to comment.