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

which page is my table row on?

Guest
Apr 19, 2010 Apr 19, 2010

Hi there

I have a large table that spans many pages in overflowing to different text frames.

How can i tell which page a row is on.. i have tried the following

function PageRowIsOn(row) //yes i do correctly pass a table row
{
    var table = row.parent;
    var frame   = table.parent;
    var pageIndex= frame.parent.index;   
    return pageIndex;
}

but it always returns 0.

So i was wondering if someone can point me in a better direction

cheers

Buzz

TOPICS
Scripting
423
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 20, 2010 Apr 20, 2010

Hi Arivu,

Your code will give you wrong page no. if your table continued on next page.

Just select one row of reflowed table on second page and run your code. It will give you page no. from which page table is start.

This code work well if you have selected a row.

row.cells[0].texts[0].parentTextFrames[0].parent.name

Shonky

Translate
Contributor ,
Apr 19, 2010 Apr 19, 2010

try this code:  return row.cells[0].texts[0].parentTextFrames[0].parent.name (or index)

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
Guest
Apr 20, 2010 Apr 20, 2010

Try the below code return the page object

function getPage(theObj)
{
     if (theObj.constructor.name == "Page") return theObj;
     if (theObj.constructor.name == "Character")
      return getPage(theObj.parentTextFrames[0]);
     if (theObj.constructor.name == "Application")
     {
          // Frame is on an unexpected place...
          alert ("Can't able to find the page");
          //exit(0);
     }
     return getPage(theObj.parent);
}

Arivu

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 20, 2010 Apr 20, 2010
LATEST

Hi Arivu,

Your code will give you wrong page no. if your table continued on next page.

Just select one row of reflowed table on second page and run your code. It will give you page no. from which page table is start.

This code work well if you have selected a row.

row.cells[0].texts[0].parentTextFrames[0].parent.name

Shonky

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