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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:42:58+00:00 2026-06-14T09:42:58+00:00

Im having a problem I have no idea how to solve. I have this

  • 0

Im having a problem I have no idea how to solve.

I have this page that contains a project. Each project has members and each member can have one or more roles. I would like to show some sort of “picklist” where all assigned roles are “checked” and its possible to add or remove roles from each member while having the model updated reflecting these changes.

I’ve created a simple http://jsfiddle.net/vinblad/PhQRr/1/ to demonstrate what Im getting at but as I said, I don’t have a clue as how to solve this so any help would be great!

Here’s the viewmodel code:

var viewModel = new function() {
   var self = this;
   self.project = ko.observable();
   self.roles = ko.observable();
};

viewModel.load = function() {
   var data = {"project":{"members":[{"member":{"name":"Vinblad
   Anders","id":13,"isDeleted":false},"roles":[{"name":"Editor","id":1,
   "isDeleted":false},{"name":"Admin","id":2,"isDeleted":false}],"id":1},{"member":
   {"name":"Gramer Mikael","id":14,"isDeleted":false},"roles": 
   [{"name":"Reader","id":1,"isDeleted":false}],"id":2}],"name":"Project 
   XYZ","number":338,"id":1},"roles":[{"name":"Admin","id":1,"isDeleted":false},  {
   "name":"Editor","id":2,"isDeleted":false}, {
   "name":"Reader","id":3,"isDeleted":false}]}
   viewModel.loadView(data);
};
viewModel.loadView = function(data) {
    viewModel.project(data.project);
    viewModel.roles(data.roles);
    ko.applyBindings(viewModel);    
};

viewModel.load();

In this sample the data is hardcoded, in reality the data comes from a webservice and I use the knockoutjs.mapping plug-in.

  • 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-14T09:43:00+00:00Added an answer on June 14, 2026 at 9:43 am

    I dont see the problem, its not even recursive as you states, If a child of project had a project as member then it would be recursive.

    Create 4 ViewModels a EditProjectMembersViewModel which has a array of ProjectViewModel which has a array of MemberViewModel which has a array of RoleViewModel

    Or just use autogenerated Viewmodels from the mapping plugin
    http://jsfiddle.net/Ed8Fv/

    ko.applyBindings(ko.mapping.fromJS(data));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I having this error during compile and i have no idea why~ Anyone can
I am having this problem with my ASP.Net application and I have no idea
I have this problem having to display my jasper report on my grails application.
Im having problem in my UIscrollView ,this is what I have done: Whenever a
I have an old C++ project and I'm having problem building it. For a
I'm having some problems with socket.io, and I have no idea how to solve
I'm having a beyond frustrating problem which I have no idea how to tackle.
im having this problem...i wonder if any of you have any ideas how to
I am having a problem and have been banging my head aginst a wall...
Im using jquerymobile together with codeigniter framework and I'm having a problem I have

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.