ie8,
function TransfData(objt) {
var spread1 = document.all("MainContentMiddleArea_CommonSpread_fsCommon");
var obj = new Object();
var columCount = spread1.GetColCount();
var colCount = columCount / 5 - 1;
var activCol = columCount + 4;
var acColName;
var acColNameAry;
var acColNameIsNs;
var acColeNscode;
//alert("列数:"+activCol);
if (activCol > 26) {
var icount = Math.floor(activCol / 26);
var code = activCol - icount * 26 + 65;
//alert("末列索引号:"+code);
var activColName = String.fromCharCode(code);
var activColAry = String.fromCharCode(code - 1);
var activColIsNs = String.fromCharCode(code - 2);
var activColNscode = String.fromCharCode(code - 4);
//alert("列名:"+activColName);
acColName = String.fromCharCode(icount + 64) + activColName;
//alert("最终列名:"+acColName);
acColNameAry = String.fromCharCode(icount + 64) + activColAry;
acColNameIsNs = String.fromCharCode(icount + 64) + activColIsNs;
acColeNscode = String.fromCharCode(icount + 64) + activColNscode;
}
else {
acColName = String.fromCharCode(activCol + 65);
acColNameAry = String.fromCharCode(activCol + 64);
acColNameIsNs = String.fromCharCode(activCol + 63);
acColeNscode = String.fromCharCode(activCol + 61);
}
// var sfoCode = spread1.GetHiddenValue(spread1.GetActiveRow(), acColName);
// var sfoAry = spread1.GetHiddenValue(spread1.GetActiveRow(), acColNameAry);
// var sfoIsNs = spread1.GetHiddenValue(spread1.GetActiveRow(), acColNameIsNs);
// var sfoNscode = spread1.GetHiddenValue(spread1.GetActiveRow(), acColeNscode);
obj.code = acColName;
var n = 0;
var starRowIndex = 0;
var endRowIndex = 0;
for (var i = 0; i < spread1.GetRowCount(); i++) {
if ((spread1.GetValue(i, 0) == spread1.GetValue(spread1.GetActiveRow(), 0)) && (spread1.GetValue(i, 1) == spread1.GetValue(spread1.GetActiveRow(), 1)) && (spread1.GetValue(i, 2) == spread1.GetValue(spread1.GetActiveRow(), 2))) {
n = n + 1;
endRowIndex = i;
}
}
starRowIndex = endRowIndex - n + 1;
var NsCodeItem = new Array(n);
var StrNsCod = "";
for (var i = 0; i < n; i++) {
// NsCodeItem = new Array();
// NsCodeItem[0] = spread1.GetHiddenValue(spread1.GetActiveRow() + i, acColName);
// NsCodeItem[1] = spread1.GetHiddenValue(spread1.GetActiveRow() + i, acColNameAry);
// NsCodeItem[2] = spread1.GetHiddenValue(spread1.GetActiveRow() + i, acColNameIsNs);
// NsCodeItem[3] = spread1.GetValue(spread1.GetActiveRow() + i, spread1.GetActiveCol() - 1);
// NsCodeItem[4] = "1";
var sfoCode = spread1.GetHiddenValue(spread1.GetActiveRow() + i, acColName);
if (sfoCode==null) {
sfoCode = "";
}
var sfoAry = spread1.GetHiddenValue(spread1.GetActiveRow() + i, acColNameAry);
if (sfoAry==null) {
sfoAry = "";
}
var sfoIsNs = spread1.GetHiddenValue(spread1.GetActiveRow() + i, acColNameIsNs);
if (sfoIsNs==null) {
sfoIsNs = "";
}
var sfoNscode = "";
var yonNscode = spread1.GetHiddenValue(spread1.GetActiveRow() + i, acColeNscode);
if (yonNscode == null) {
sfoNscode = spread1.GetValue(spread1.GetActiveRow() + i, spread1.GetActiveCol() - 1);
if (sfoNscode==null) {
sfoNscode = "";
}
}
if (yonNscode != null) {
var sfoNscodeN = spread1.GetValue(spread1.GetActiveRow() + i, spread1.GetActiveCol() - 1);
if (sfoNscodeN.split("(").length > 0) {
sfoNscode = spread1.GetHiddenValue(spread1.GetActiveRow() + i, acColeNscode);
}
if (sfoNscodeN.split("(").length == 0) {
sfoNscode = spread1.GetValue(spread1.GetActiveRow() + i, spread1.GetActiveCol() - 1);
}
}
if (i < n - 1) {
StrNsCod += sfoCode + "|" + sfoAry + "|" + sfoIsNs + "|" + sfoNscode + "|" + "VFI" + "|";
}
if (i == n - 1) {
StrNsCod += sfoCode + "|" + sfoAry + "|" + sfoIsNs + "|" + sfoNscode + "|" + "VFI";
}
}
var win = window.showModalDialog('OESF30S110.aspx?NscodeItems=' + StrNsCod, NsCodeItem, 'dialogWidth:1020px; dialogHeight:750px;status:yes;help:yes;resizable=yes;', true);
if (win != null) {
var ValueAry = win.split("|");
var leng = ValueAry.length / 5;
var NewAryItem = new Array(4);
for (var i = 0; i < leng; i++) {
NewAryItem = new Array();
for (var j = 0; j < 5; j++) {
NewAryItem[j] = ValueAry[j + i * 5];
if (NewAryItem[4] == "1") {
spread1.SetValue(spread1.GetActiveRow(), spread1.GetActiveCol() - 1, NewAryItem[3]);
// alert(NewAryItem[1]);
// alert(NewAryItem[2]);
//spread1.SetHiddenValue(spread1.GetActiveRow(), acColNameAry, NewAryItem[1]);
var rowindex = spread1.GetActiveRow();
var colName = acColeNscode;
var valueName = NewAryItem[2];
//spread1.SetHiddenValue(rowindex, colName, valueName);SetHiddenCellValue
//spread1.SetHiddenCellValue(rowindex, colName, valueName);
//spread1.SetHiddenValue(0, "K", "test2");
//alert(spread1.GetHiddenValue(0, "K")); //'test2'
}
for (var rindex = starRowIndex; rindex <= endRowIndex; rindex++) {
if (NewAryItem[0] == spread1.GetHiddenValue(rindex, acColName) && NewAryItem[1] == spread1.GetHiddenValue(rindex, acColNameAry)) {
spread1.SetValue(rindex, spread1.GetActiveCol() - 1, NewAryItem[3]);
//spread1.SetHiddenValue(spread1.GetActiveRow() + i, acColNameAry, NewAryItem[1]);
//spread1.SetHiddenValue(spread1.GetActiveRow() + i, acColeNscode, NewAryItem[2]);
}
}
}
}
}
return false;
} |