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 8949325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:11:41+00:00 2026-06-15T13:11:41+00:00

I am trying to populate instagram images using backbone, I have basically 3 models

  • 0

I am trying to populate instagram images using backbone,

I have basically 3 models as follows,

User model store all the user info related to instagram

App.Models.User = Backbone.Model.extend({
    defaults: {
        id: '',
        access_token: '',
        userid: '',
        username: '',
        full_name: '',
        profile_picture: ''
    },
    urlRoot: "/api/user/",
    initurl: function() {
        return "https://api.instagram.com/v1/users/"+this.get('userid')+"/media/recent/?access_token=" + this.get('access_token');
    },
    initialize: function() {
        this.set('id', $('#domdump .id').val());
        this.fetch({
            success: function(model) {
                var photos = new App.Collections.Ig_photos([],{
                    url: model.initurl()
                });
            }
        });
    }

});

A model to store the next url for pagination

App.Models.Ig_next_url = Backbone.Model.extend({
    defaults: {
        next_url: ''
    },
    next_url:function(){
        return this.get('next_url');
    }
});

A model for the photo

App.Models.Ig_photo = Backbone.Model.extend({});

A collection for the multiple photo

App.Collections.Ig_photos = Backbone.Collection.extend({
    model: App.Models.Ig_photo,
    initialize: function(model, options) {
        this.url = options.url;
        this.nextSet();
    },
    sync: sync_jsonp,
    parse: function( response ) {
        if(response.pagination && response.pagination.next_url && response.pagination.next_url != this.url){
            var next_url = new App.Models.Ig_next_url({ next_url: response.pagination.next_url });
            this.url = next_url.next_url();
        }
        return response.data;
    },
    nextSet: function(){
        this.fetch({
            success: function(photos){
                var ig_photos_views = new App.Views.Ig_photos_view({ collection: photos});
                console.log(photos);
            }
        });
    }
});

Also i have some views that does the render with a load more button that calls the nextset of the collection.

What i was trying to achieve is the photos get appended to the collection upon nextset() and the collection get updated with pervious data + new data but right now its getting overwritten.

Also is it okay to instantiate new collection from the modelfetch ?

  • 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-15T13:11:43+00:00Added an answer on June 15, 2026 at 1:11 pm

    You shouldn’t need to make a new view. You should instead listen to the “add” event being triggered on the collection and render new items accordingly.

    nextSet: function(){
        this.fetch({add : true}); // The add option appends to the collection
    }
    

    This option is detailed in the very good documentation.

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

Sidebar

Related Questions

I am trying to populate a list of images dynamically using javascript. I have
Im trying to populate my domain models and child entities with 1 SQL Store
Im trying to populate my Html.Listbox with all the users of my ASP.NET user
I am trying to populate a gridview using LayoutInflator.. According to me the code
Hi I am trying to populate markers on google map and using Json to
Im trying to populate a dropdown list using jquery. The population has but the
I am trying to populate a string with a double value using a sprintf
I'm trying to populate an NSArray with a collection of images in Resources. However,
I'm trying to populate an xml file into a Delphi ListView1, then group all
I'm trying to populate a field called 'identification' using the primary key 'id'. However,

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.