locked
navigate to some location in the same page RRS feed

  • Question

  • Hi 

    We would like to make a context menu for our home page (that divide for 3 sections).

    Pressing on one of the content in the menu will lead to scrolling to the relevant section (its all in the same page).

    Its important to mention that we are using listView control that divide our page to groups.

    my questions are:

    There is a way to scroll within the same page to item location?

    There is a way to know the index (x,y) of specific group in our list view?

    Sunday, August 12, 2012 10:30 AM

Answers

  • HI

    For the first question you can refer to this discussion

    http://social.msdn.microsoft.com/Forums/en/winappswithhtml5/thread/3faecf8e-6bbf-406d-a3b2-8d0c7081bb84

    For the second, that's depend on your design

    For example:

    (function () { "use strict"; var shoppingItemsList = new WinJS.Binding.List(); var preferredStoresList = new WinJS.Binding.List(); WinJS.Namespace.define("ViewModel", { UserData: WinJS.Binding.as({ homeZipCode: null, }), State: WinJS.Binding.as({ selectedItemIndex: -1 }) }); })();

    Then you can bind the index to your selectedItemIndex

    WinJS.Utilities.children(targetElement).listen("click", function (e) {
    ViewModel.State.selectedItemIndex = this.rowIndex - 1;
    });

    • Marked as answer by Dino He Monday, August 20, 2012 1:26 PM
    Tuesday, August 14, 2012 3:33 PM