Problem With Changing Image Viewer Location Programmatically, on a Web Part Page using JSOM RRS feed

  • Question

  • I have some javascript which updates several properties of an image viewer that I have on the page. I wanted to experiment a bit so in my code I added some logic to move the Image Viewer around a bit on the page, using the zone and zoneIndex properties. But doing this seems to yield inconsistent results as explained below.

    Originally I had placed the Image Viewer on the page in the Header Zone, after another web part(an HTML Form web part). So I first tried to move it to the empty "Top Left" zone on the page. So when I refreshed the page and my code executed, the Image Viewer web part actually ended up in the "Right" zone underneath a Script Editor web part that was already previously there.

    I then tried a second time to move it to a different location to the "Center" zone and it again would up in the "Right" at the bottom of the page.

    Then on my third try I attempted to move it to the "Footer" zone on the page and it was successfully moved to that zone when I refreshed the page.

    Next I programmatically moved it back  to its original location in the "Header" zone.

    When I tried to move it to the "Top Right" zone on the page it again was instead moved to the bottom of the "Right" zone at the bottom of the page.

    So can someone give me a set of steps for properly moving a web part around on a page programmatically, and consistently all of the time?




    Thursday, March 23, 2017 8:04 PM


All replies