Copy link to clipboard
Copied
Hello.
the snippet below worked for a while. After some changings in my script it doesn´t...
I´ve verified it: the table I want to change HAS a head-row. But the script doesn´t recognize it (?) and parses the content of the IF-condition, it shouldnt.
...
myTable = allSelection.tables[0];
var myFirstRow = myTable.rows[0];
var myLastRow = myTable.rows[-1];
// Wenn die erste Zeile keine Kopfzeile ist ...
if(myFirstRow.rowType != "HEADER_ROW"){
alert(myFirstRow.rowType);
// ... diese in eine Kopfzeile konvertieren
//myFirstRow.rowType = RowTypes.HEADER_ROW;
}
// Wenn die letzte Zeile keine Fusszeile ist ...
if(myLastRow.rowType != "FOOTER_ROW"){
alert(myLastRow.rowType);
// ... diese in eine Fusszeile konvertieren
//myTable.rows[-1].rowType = RowTypes.FOOTER_ROW;
}
...
Is something wrong within?
rowType is an Enumeration
Try this
myFirstRow.rowType != RowTypes.HEADER_ROW
or
myFirstRow.rowType.toString() != "HEADER_ROW"
Thanks Stefan
Copy link to clipboard
Copied
rowType is an Enumeration
Try this
myFirstRow.rowType != RowTypes.HEADER_ROW
or
myFirstRow.rowType.toString() != "HEADER_ROW"
Thanks Stefan
Copy link to clipboard
Copied
It´s perfect.
Sometimes it is very logical....
So (if I´ve really understood) "HEADER_ROW" is a part of the array "RowTypes". Isn´t it?
Thank you Stefan!