locked
Can't get search to work

    Question

  • I'm following the Adding a Search Contract item template but selecting one of the items found in the search results always takes me to the first group instead of the group where the search term is.

    So I created a brand new SplitView to test, and followed the steps, and it does the same thing.

    The _itemInvoked gets the correct group and item, but

                    nav.navigate("/pages/split/split.html", { group: item.data.group, selectedIndex: idx

    navigates to the first group, not the one specified in item.data.group

    Any ideas what I am missing? I followed the instructions several times... :-)

    Thanks!

    Alex

    Saturday, August 25, 2012 4:18 PM

All replies

  • Poking around some more I can see that the navigate function wants a "groupkey" property in the options, but the search code isn't passing that...
    Saturday, August 25, 2012 5:46 PM
  • Looks like I may wind up answering my own questions :-)

    I figured out how to pass it a groupKey, so now it brings up the correct group page. But it doesn't pull the correct item.

    The code from the example is:

        var idx = Data.items.indexOf(item.data, 0)

    But this returns the index number of the item across all the groups (#9 in my test).

    The navigation expects to get the number relative to the group (#2 in my test) in selectedIndex.

    Has anyone successfully implemented Search in a Split Page template?

    Thanks!

    Alex

    Sunday, August 26, 2012 12:31 AM
  • You would need to add logic to your application to indicate what specific item you want to 'pull' (whatever pull means in your context).  There is no built in way to navigate there.

    Jeff Sanders (MSFT)

    Tuesday, August 28, 2012 12:33 PM
    Moderator