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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:04:09+00:00 2026-06-11T03:04:09+00:00

Having trouble understanding how to best do the following in Knockout: I’m porting a

  • 0

Having trouble understanding how to best do the following in Knockout:

I’m porting a multi-page server-side app to Knockout, which does a lot of different functionality and data on various pages, for example:

  • List all users
  • View a user page
  • Edit a user page
  • Your account settings
  • etc.

These various pages are shown in the main part of each page, with a common header, sidebar, and footer.

There is common data on all pages (in header and sidebar), and I’d like this to behave like a ‘single page’ app (with animations between sections, etc)

Pending your feedback, I’m thinking the best approach would be to have:

  • One main model, with submodels for each ‘page’
  • Common observables applicable to the header, sidebar, etc
  • An observable that indicates the ‘active page’ and template

For example:

var MainModel = {
   listUsersModel: { ... },
   userModel: { ... },
   accountModel: { ... },
   commonProperty: ko.observable('Blah'),
   anotherCommonProperty: ko.observable('Blah'),
   activeSection: ko.observable('listUsers')

}

While I think this will work, I’m a little fuzzy about how to “switch pages”, and update new page’s model with fresh server-side data.

Is the best/only way to do this something like:

MainModel.userModel.userId(123456)
// userModel above subscribes to userId changes, to get new server via ajax
MainModel.activeSection = 'viewUser'

?

  • 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-11T03:04:11+00:00Added an answer on June 11, 2026 at 3:04 am

    Here’s an example from RNiemeyer that answers what I need:

    https://github.com/rniemeyer/SamplePresentation/tree/master/js

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

Sidebar

Related Questions

Having trouble understanding. With the following css : .bloc .field:nth-last-child(2){ ...some values... } and
from here Im having trouble understanding they say that ado.net does not include a
Im having trouble understanding why the following code displays The First Key = (null)
I'm having trouble understanding how to get the following working in interface builder. I've
Background: I'm having some trouble understanding exactly how to best use controllers in an
I am having trouble understanding how to best use Core Data to solve this
I'm having trouble understanding following code: if (IsPostBack) { int CheckBoxIndex; ArrayList CheckBoxArray; bool
Having trouble understanding how to filter an images table by tag information in a
Im having trouble understanding class relationships after being asked to research it further, would
Im having trouble understanding this : why Microsoft put Xattribute under Xobject ? they

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.