|
|
@@ -377,8 +377,23 @@ projectGljObject={
|
|
|
let dataCode = me.projectGljSetting.header[args.col].dataCode;
|
|
|
if(dataCode=='name'&& recode && gljUtil.isMaterialType(recode.type)) projectObj.project.projectGLJ.updateCalcMaterial(recode,'calcMaterial',1);
|
|
|
},
|
|
|
- onProjectGljSelectionChange:function (sender, args) {
|
|
|
+ setSelectionWhenMaterialChange:function(material){
|
|
|
+ if(material){
|
|
|
+ let i = _.findIndex(this.projectGljSheetData,{id:material.id})
|
|
|
+ if(i != -1){
|
|
|
+ let os = this.projectGljSheet.getSelections();
|
|
|
+ let ns = [{col:os[0].col,colCount:1,row:i,rowCount:1}]
|
|
|
+ this.projectGljSheet.setSelection(ns[0].row,ns[0].col,ns[0].rowCount,ns[0].colCount);
|
|
|
+ this.projectGljSheet.showRow(i, GC.Spread.Sheets.VerticalPosition.center);
|
|
|
+ this.onProjectGljSelectionChange({},{newSelections:ns,oldSelections:os},true);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onProjectGljSelectionChange:function (sender, args,fromMaterial=false) {
|
|
|
let me = projectGljObject;
|
|
|
+ console.log(args)
|
|
|
let newSel = args.newSelections[0];
|
|
|
let oldSel = args.oldSelections?args.oldSelections[0]:{};
|
|
|
me.projectGljSheet.suspendPaint();
|
|
|
@@ -390,7 +405,7 @@ projectGljObject={
|
|
|
if(me.projectGljSheetData[orow]){
|
|
|
let tstyle = gljOprObj.getSelStyle(false,{},me.projectGljSheetData[orow].bgColour);
|
|
|
me.projectGljSheet.setStyle(orow, -1, tstyle);
|
|
|
- me.projectGljRowChang();
|
|
|
+ me.projectGljRowChang(fromMaterial);
|
|
|
}
|
|
|
}else{
|
|
|
me.projectGljSheet.repaint();
|
|
|
@@ -398,7 +413,7 @@ projectGljObject={
|
|
|
me.projectGljSheet.resumeEvent();
|
|
|
me.projectGljSheet.resumePaint();
|
|
|
},
|
|
|
- projectGljRowChang:function(row){
|
|
|
+ projectGljRowChang:function(fromMaterial){
|
|
|
let me = projectGljObject;
|
|
|
let sel = me.mixRatioSheet.getSelections()[0];
|
|
|
sel.row = -1;
|
|
|
@@ -406,6 +421,7 @@ projectGljObject={
|
|
|
sel.rowCount = 1;
|
|
|
sel.colCount = 1;
|
|
|
me.showMixRatioData();
|
|
|
+ if(fromMaterial != true) materialCalcObj.showDatas();
|
|
|
},
|
|
|
rightClickCallback:function (row) {
|
|
|
let me = projectGljObject;
|
|
|
@@ -622,7 +638,7 @@ projectGljObject={
|
|
|
this.projectGljSheet.setRowCount(this.projectGljSheetData.length);
|
|
|
sheetCommonObj.showData(this.projectGljSheet, this.projectGljSetting,this.projectGljSheetData);
|
|
|
//this.projectGljSheet.setRowCount(this.projectGljSheetData.length);
|
|
|
- sel.row = oldData?_.findIndex(this.projectGljSheetData,{'id':oldData.id}):'';
|
|
|
+ sel.row = oldData?_.findIndex(this.projectGljSheetData,{'id':oldData.id}):0;
|
|
|
this.projectGljSheet.setSelection(sel.row==-1?0:sel.row,sel.col,sel.rowCount,sel.colCount);
|
|
|
},
|
|
|
showMaterialTreeData:function () {
|