Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8473461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:21:30+00:00 2026-06-10T17:21:30+00:00

I’m new to windows 8 metro style app development and I come from PHP

  • 0

I’m new to windows 8 metro style app development and I come from PHP based web application development background.

Now, in my app I fetch data using WinJS.xhr and add it to WinJS.Binding.List list. The problem is when I revisit the page, the old data acquired from the previous xhr code is still there and the new data appends to this list.

How to rectify this?

EDIT

Homedeliverydata.js file

     var list = new WinJS.Binding.List();
        var groupedItems = list.createGrouped(
            function groupKeySelector(item) { return item.group.key; },
            function groupDataSelector(item) { return item.group; }
        );

        function getFeaturedRestaurants(city_id) {
            Utilities.featuredRestaurants(city_id, 'home_delivery').
                then(function onComplete(result) {
                    var restaurants = result.result;

                    for (var i = 0; i < restaurants.length; i++) {
                        restaurants[i].group = Groups[0];
                        restaurants[i].key = restaurants[i].id;
                        list.push(restaurants[i]);
                    }
                },
                function onError() {
                }, function onProgress() {
                });
        }
  function clearData() {
        list.splice(0, list.length);
        list._currentKey = 0;
    }

HomeDelivery.js

  ready: function (element, options) {
            //code above this line removed
           HomeDeliveryListdata.GetSearchData(params).then(afterCall, function (req) { }, function (req) { });

        },
 unload: function () {
            HomeDeliveryListdata.clearData();
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T17:21:32+00:00Added an answer on June 10, 2026 at 5:21 pm

    The list will last the lifetime of the variable it is being assigned to. In addition, if you are using the single page model for you app (the default, recommended way), then the variable containing the list will likely survive from page to page.

    If you want the existing list to be replaced each time you visit a page, make sure that you are scoping the lifetime of the list appropriately (usually scoping the list to the success promise of the xhr request is sufficient) or writing code to clear and refresh the list.

    Hard to point out the exact fix without example code, but hopefully that will help you fix the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.