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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:56:28+00:00 2026-05-24T20:56:28+00:00

something strange here, i have those two portions of code in two files, base.js

  • 0

something strange here, i have those two portions of code in two files, base.js and filter.js :
//definition of generic object class

var baseObject = Backbone.Model.extend({
    copy: function(){
        _clipBoard=this;
    },
    fetch: function(){
        var obj =this;
        var criteriaString = encodeURI(JSON.stringify({_id:this.get("_id")}));
        var getUrl = _rootUrl+'/nalab/'+this.getMongoType()+'/';
        $.getJSON(getUrl + "_find", 'criteria=' + criteriaString, function(data){
            var results = data.results;
            obj.set(results[0]);
        });
    }
});

//definition of a baseObject subclass called filter with speical methods
var Filter = baseObject.extend({
    getTitleField : function(){
        return 'title';
    },
    getMongoType: function(){
        return 'filter';
    }
});

Then I do the following code in firefox 5 :

var filter = new Filter({_id:{$oid:"4e43ca017c36ec707b755659"}});
filter.fetch();
console.log(filter);
/*
Firebug shows an object with "attributes" that contains a field 'title'='Filtres avances'
*/
console.log(filter.get('title');
/*
Firebug says undefined
*/

So, why does “super” get method doesn’t work for Filter class although it works for baseObject class and never overrid it?

  • 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-05-24T20:56:30+00:00Added an answer on May 24, 2026 at 8:56 pm

    Because you try to get title before ajax request is finished and your data is set to model.
    If you want to get your data, try this:

    var filter = new Filter({_id:{$oid:"4e43ca017c36ec707b755659"}});
    filter.bind('change', function(model) {
        console.log(model.get('title');
    });
    filter.fetch();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I realize it's probably something strange, but here is what I have. I have
Something really strange is going on here. I bought a new Mac last week,
I truly hope I've missed something simple here, but I'm running into a strange
Something strange is happening in my code where I'm using a StackTrace. It's almost
I just noticed something strange. If I have this XML: <level number=7 background=background_5> and
I have something strange in my app. If in the ressources I have 2
When saving a new entity something strange happens... I have a data grid with
I'm at a loss here. I have this class I've created that takes arguments
I have this strange thing happening to my code. Using Firefox or Chrome (tried
I have encountered a strange behavior with a simple C++ class. classA.h class A

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.