Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

check if supreme row is a HEAD-ROW

Engaged ,
Apr 26, 2017 Apr 26, 2017

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?

TOPICS
Scripting
405
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Apr 26, 2017 Apr 26, 2017

rowType is an Enumeration

Try this

myFirstRow.rowType != RowTypes.HEADER_ROW

or

myFirstRow.rowType.toString() != "HEADER_ROW"

Thanks Stefan

Translate
Engaged ,
Apr 26, 2017 Apr 26, 2017

rowType is an Enumeration

Try this

myFirstRow.rowType != RowTypes.HEADER_ROW

or

myFirstRow.rowType.toString() != "HEADER_ROW"

Thanks Stefan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 26, 2017 Apr 26, 2017
LATEST

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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines