3 Replies Latest reply on Apr 20, 2010 9:05 AM by Shonkyin

    which page is my table row on?

    BuzzBar2 Level 1

      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





        • 1. Re: which page is my table row on?
          milligramme Level 3

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

          • 2. Re: which page is my table row on?
            sudar1983_14 Level 2

            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");
                 return getPage(theObj.parent);




            • 3. Re: which page is my table row on?
              Shonkyin Level 3

              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.