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

check if supreme row is a HEAD-ROW

Engaged ,
Apr 26, 2017 Apr 26, 2017

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?

TOPICS
Scripting

Views

283

Translate

Translate

Report

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

Contributor , 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

Votes

Translate

Translate
Contributor ,
Apr 26, 2017 Apr 26, 2017

Copy link to clipboard

Copied

rowType is an Enumeration

Try this

myFirstRow.rowType != RowTypes.HEADER_ROW

or

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

Thanks Stefan

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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!

Votes

Translate

Translate

Report

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