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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:13:54+00:00 2026-05-28T05:13:54+00:00

I would like to bind a visible property to be true when one of

  • 0

I would like to bind a visible property to be true when one of two conditions are true. Something like the following

 <tr data-bind="visible: active || $parent.displayDeactive">....</tr>

My code works when I do one or the other bindings but not when I put the || in there. I haven’t found any documentation that says I can put any logic in this binding, but if I can’t do it directly what is the est way to do it since I am binding a property of a template and one object of the $parent viewmodel.

  • 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-28T05:13:54+00:00Added an answer on May 28, 2026 at 5:13 am

    If you are using the value of an observable in an expression then you need to reference them as a function. So, if active and displayDeactive are observables you would do:

    data-bind="visible: active() || $parent.displayDeactive()"

    There are a few ways to move it to the view model, you could:

    • create a computed observable on the child (function would need to be able to reference the parent)
    • create a function on the parent that takes in the child and returns your value (bindings are executed in a computed observable, so it will fire again when any observable that it accesses changes)
    • create a function on the child that takes in the parent and returns the value (same note as above)

    Sample of logic in the binding and using a function on the parent here: http://jsfiddle.net/rniemeyer/f6ZgH/

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

Sidebar

Related Questions

I would like to bind a property in the source data to an int.
I would like to bind data of my listbox. Imagine I have something like
I would like to be able to programmatically bind some data to the dependency
I have the following XAML in a WPF application. I would like to bind
I would like to bind the User.Password property to PasswordBox (TwoWay). Since PasswordBox.Password is
I would like to bind two events together. Right now my set up is
I would like to bind the foreground property of a TextBlock to a Property
I would like to Bind two models (say ModelA and ModelB classes) to a
I would like to bind a variable from my ActionScript to a property of
I would like bind an array data to view in ASP.NET MVC, how can

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.