WinJS custom semantic zoom doesn't call “beginZoom” and “positionItem” methods


  • I've looked in the forum for similar problem, but didn't get what I was looking for, that's why I create that question.

    I've created a custom semantic zoom widget, implementing the WinJS ZoomableView interface. The container that is zoomed is not a pure list or a grid, but contains several floated DIV elements and a list. When an group from the zoomed-in view is clicked, then I calculate the left offset and manually scroll the container, in order to focus on the selected group. This code is implemented inside the "positionItem" method. It works fine on a Surface, but from time to time on a desktop the "positionItem" and the preceding "beginZoom" are not called. And in such cases, when it goes from zoomed-in to zoomed-out view the container is not scrolled.

    getPanAxis: function () {
        return "horizontal";
    beginZoom: function () {
    positionItem: function (item, position) {
        var currentItem = document.activeElement;
        var currentID = currentItem.children.item(0).title.toLowerCase();
        var currentOffset = this._calculateOffset(currentID);
        document.querySelector(".semanticZoomContainer > div > div > div").scrollLeft = currentOffset;
    endZoom: function (isCurrentView, setFocus) {

    I've tried to use the parameters of the "positionItem" method, but with no success. I thought that having not implemented "getCurrentItem" method, this means that "positionItem" is not also called. But this is not absolutely true, because the "beginZoom" is not also called, which precedes any other. So it's seems I've implemented something wrong and I'll be glad if somebody can help me. The other option is that there is a bug in WinJS Semantic Zoom, but I don't think so.

    Thank you in advance for the help.

    Best regards,

    Nikolay Alipiev

    Tuesday, October 22, 2013 8:53 AM

All replies

  • Can you post a complete repro project to SkyDrive? That way we can see the problem happening and help you better.

    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Wednesday, October 23, 2013 12:03 AM
  • Thank you for the answer!

    I cannot do that for the moment. I just wanted to ask if there is a bug, about the zooming events, that is known. If there isn't such a bug, it seems I've implemented something wrong. I will work on this and if I have some additional questions I will ask you.

    Thank you for the moment.

    Best regards,

    Nikolay Alipiev

    Friday, November 08, 2013 3:49 PM