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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:29:20+00:00 2026-06-16T05:29:20+00:00

Is there any way I can do have a Javascript class that extends an

  • 0

Is there any way I can do have a Javascript class that extends an object that was created through the revealing module pattern? I tried the following code, but is there away to achieve the same thing?

sv.MergeQuestionViewModel = function () {
    this = sv.QuestionDetailViewModal();
    this.init($("#mergeQuestionModel"));
};  

sv.QuestionDetailViewModal = function () {
    var $el,
        self = this,
        _question = ko.observable(),
        _status = new sv.Status();

    var _init = function (el) {
        $el = el;
        $el.modal({
            show: false,
            backdrop: "static"
        });
    };

    var _show = function () {
        $el.modal('show');
    };

    var _render = function (item) {
        _question(new sv.QuestionViewModel(item));
        _show();
    };

    var _reset = function () {
        _question(null);
        _status.clear();
    };

    var _close = function () {
        $el.modal('hide');
        _reset();
    };

    return {
        init: _init,
        show: _show,
        render: _render,
        reset: _reset,
        close: _close
    };
};
  • 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-16T05:29:21+00:00Added an answer on June 16, 2026 at 5:29 am

    You could use jQuery.extend to achive this behaviour.

    sv.MergeQuestionViewModel = function () {
        $.extend(this, sv.QuestionDetailViewModal);
    
        this.init($("#mergeQuestionModel"));
    };
    
    sv.QuestionDetailViewModal = (function () {
     var el,
    
     _init = function($el) {
        el = $el;
        console.log('init', el);
     },
    
     _render = function() {
        console.log('render', el);
     };
    
     return {
       init : _init,
       render : _render
     };
    }());
    
    var view = new sv.MergeQuestionViewModel();
    view.render();
    

    Test it on http://jsfiddle.net/GEGNM/

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

Sidebar

Related Questions

Is there any way that I can pass arguments in selector? example: I have
Does anyone know do there have any way that I can encrypt the array
Is there any way I can have a thread branch off into its own
Is there any way I can combine list of expressions into one? I have
If I have a console application, is there any way I can handle the
Is there any way I can set a formatter on models that will convert
I currently have created a pagination JavaScript class that will automatically paginate comments when
Is there any way can declare a bean in just like JSP UseBean in
Is there any way we can fetch X509 Public Cetrificates using c# from AD
Is there any way I can use JPA or hibernate annotations to specify the

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.