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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:08:25+00:00 2026-06-12T14:08:25+00:00

I am loading data from a web API like this: $.getJSON(/api/Rule, function (rules) {

  • 0

I am loading data from a web API like this:

$.getJSON("/api/Rule", function (rules) {
    self.Rules(rules);
});

Then I bind Rules to a table using a foreach binding. Each Rule has the properties: Keyword, Attribute, and Value.

I want to check if Keyword is a certain value which controls the visibility of some controls.

data-bind="options: viewModel.Attributes, visible : Keyword != 'Else'"

The problem is the visibility is not updating when I change the value of Keyword to a different value.

How do I get this to work?

If it is supposed to be through some kind of binding, I did not declare a special object in my view model and I am just using whatever was returned from the server.

  • 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-12T14:08:26+00:00Added an answer on June 12, 2026 at 2:08 pm

    Frankly, you must map your objects to observables. That’s how knockout is able to do its magic. Using the mapping plugin will make this trivial.

    $.getJSON("/api/Rule", function (rules) {
        var mappedRules = ko.mapping.fromJS(rules);
        self.Rules(mappedRules);
    });
    

    Otherwise you can map it yourself.

    $.getJSON("/api/Rule", function (rules) {
        var mappedRules = ko.utils.arrayMap(rules, function (rule) {
            return {
                Keyword: ko.observable(rule.Keyword),
                Attribute: ko.observable(rule.Attribute),
                Value: ko.observable(rule.Value)
            };
        });
        self.Rules(mappedRules);
    });
    

    Just remember that you are now dealing with observables now so you need to adjust your bindings.

    data-bind="options: viewModel.Attributes, visible : Keyword() != 'Else'"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am loading data from table to flat file destination, where my flat file
We are loading data from db: var somethings = Context.SomethingSet.ToList(); Then someone deletes or
In my application, I'm loading some data from a file. This can fail and
I am loading approximately 60 to 80 data from web-service. But If you have
I'm writing a web-app for the iPad that will be loading data from a
I have an error where I am loading data from a web-service into the
Currently I am loading data from a previous session into my application using the
I'm loading data from a MySQL database into a C# .NET application. The data
I have a flash file that is loading data from XML file. After I
I'm reading data from a file -> saving into DB -> Loading my Custom

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.