Author Topic: UIGrid Immediate Reposition()  (Read 1437 times)

nguiman

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
UIGrid Immediate Reposition()
« on: March 24, 2014, 01:22:36 PM »
I have some methods which make some changes to a grid (add or remove to), I include a call to UIGrid::Reposition() at the end of the method hoping for those changes to show immediately. But it appears both Reposition and repositionNow have no affect on the grid while in the method. I've only been able to see the grid correctly positioned when Reposition is put in the Update method, but I don't want it to run all the time.

How can I resolve this? and whats the cause?
« Last Edit: March 24, 2014, 03:47:05 PM by nguiman »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIGrid Immediate Reposition()
« Reply #1 on: March 24, 2014, 06:29:19 PM »
Reposition() won't work until after UIGrid's Start() function has had a chance to execute. Likewise it won't work if the component is disabled.

nguiman

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
Re: UIGrid Immediate Reposition()
« Reply #2 on: March 25, 2014, 12:14:38 AM »
Thanks, that makes sense, I'll definitely keep that in mind.