/** * Created by Jacky.gao on 2016/9/18. */ import AttributeCell from './AttributeCell.js'; import Row from './Row.js'; import ConditionRow from './ConditionRow.js'; import CustomCell from './CustomCell.js'; export default class AttributeRow extends Row{ constructor(table,rowData){ super(table); this.rowData=rowData; this.conditionRows=[]; this.tr=$(``); this.tr.append(this.newAttributeCell()); this.tr.append(this.newConditionCell()); this.tr.append(this.newScoreCell()); this.initCustomCells(); } addCustomCol(customCol){ const cell=new CustomCell(this,customCol); this.tr.append(cell.td); customCol.customCells.push(cell); for(let row of this.conditionRows){ row.addCustomCol(customCol); } } removeCustomCol(customCol){ let posArray=[]; for(let i=0;i0){ this.conditionRows[this.conditionRows.length-1].tr.after(newConditionRow.tr); }else{ this.tr.after(newConditionRow.tr); } this.conditionRows.push(newConditionRow); } toXml(){ let xml=""; for(let row of this.conditionRows){ xml+=row.toXml(); } xml+=""; return xml; } }