TFS 1.X+ get current page in container with pagination

Discussion in 'Support' started by Joe Rod, Aug 10, 2018 at 12:23 PM.

  1. Joe Rod

    Joe Rod JoeRod #1189

    Joined:
    Mar 16, 2011
    Messages:
    485
    Likes Received:
    112
    Best Answers:
    2
    Is there a way to get current page on container with pagination?
    I.E. If i am
    [​IMG]
    current page it would be 2

    update:
    I'm trying to get container slot to get its item (if any) there when i'm moving an item into that container. On first page is ok because getItemByIndex(index) do the work, but problem starts on other pages which i cannot figure the way to get the item there.
    I know i can get the number of items using size() and indexes come from 0 to capacity() - 1, but no idea how to use those to calculate actual item index/slot
     
    Last edited: Aug 10, 2018 at 7:00 PM
  2. Best Answer:
    Post #4 by Nekiro, Aug 10, 2018 at 8:01 PM
  3. Nekiro

    Nekiro worst coder Support Team

    Joined:
    Sep 7, 2015
    Messages:
    1,664
    Likes Received:
    513
    Best Answers:
    65
    I think no, but you can get item index in container and calculate it, for example container has 30 slots and its paginated, indexes starts from 0, then 30 item is on page 2, 29 is on page 1. If you arent working with any item, you just need the page for some reason, then its prolly not possible.
     
    Joe Rod and kito2 like this.
  4. Joe Rod

    Joe Rod JoeRod #1189

    Joined:
    Mar 16, 2011
    Messages:
    485
    Likes Received:
    112
    Best Answers:
    2
    Ty for answer. Let me explain better
    I'm trying to get container slot to get its item (if any) there when i'm moving an item into that container. On first page is ok because getItemByIndex(index) do the work, but problem starts on other pages which i cannot figure the way to get the item there.
    I know i can get the number of items using size() and indexes come from 0 to capacity() - 1, but no idea how to use those to calculate actual item index/slot
     
  5. Nekiro

    Nekiro worst coder Support Team

    Joined:
    Sep 7, 2015
    Messages:
    1,664
    Likes Received:
    513
    Best Answers:
    65
    Best Answer
    Ah, when moving the item. Afaik cipsoft client (not sure about otc), does not calculate the exact slot after page 1 (container index > container maxsize), when you move item to paginated container, it's moved into the first slot (index 0 and that's what cipsoft client is sending), that's why you can't get what you want.
     
    Last edited: Aug 10, 2018 at 8:13 PM
    Joe Rod likes this.

Share This Page

Loading...