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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:40:46+00:00 2026-05-27T23:40:46+00:00

This is the .haml code that contains my bindings. I removed bindings that weren’t

  • 0

This is the .haml code that contains my bindings. I removed bindings that weren’t relevant.

#date-extension
  .filter-extension-container
    .filter-extension-button
      .button-close
    #hand-graph-container{"data-bind" => "with:dateGraph"}
      #x-axis
      #hand-graph{"data-bind" => "foreach: {data:graphData}"}
        %div{"data-bind" => "interactiveBar: $data"}

And I have the beginnings of a custom binding, like so.

ko.bindingHandlers.interactiveBar = {
  init: function(element, valueAccessor, allBindingsAccessor, viewModel) {
debugger;
  },
  update: function(element, valueAccessor, allBindingsAccessor, viewModel) {

  }
};

But when I look at viewModel, it is equal to the valueAccessor and is just the data object that I’m passing in. I’d like access to the dateGraph viewModel, and should be able to access it since I have used “with: graphData” according to the documentation.

  • 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-27T23:40:47+00:00Added an answer on May 27, 2026 at 11:40 pm

    Inside of a foreach the viewModel property is the data being bound at that scope level.

    There are a couple of options (assuming you are using Knockout 2.0):

    • pass $parent instead of $data and access your dateGraph object via valueAccessor()

    • or the 5th argument to a binding handler is actually the binding context. The binding context will have $data, $parent, $parents, and $root properties. You can see a description of the properties here.

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

Sidebar

Related Questions

It seems that inside of HAML's :javascript filter, no Ruby code is allowed, not
not sure if it matters that I run the code from haml this line
I have a ajax method that renderes a @collection of users. This code is
I have the following html.erb code that I'm looking to move to Haml: <span
I'm using HAML's markdown filter, like this: :markdown This is markdown text, yay! but
I have this code: = link_to unsubscribe instantly, *|UNSUB|*.html_safe That generates this HTML: <a
I have this Haml view: !!! strict %html{:xmlns => http://www.w3.org/1999/xhtml} %head %meta{:content => text/html;
I have this in one of my haml views: -form_for :news_item_comment, :url=>{:id => comment.id,
Let's first start with a code snippet to explain the issue: = Haml::Engine.new('#bar= yield').render
I've looked at this article and am getting strange behavior in a HAML partial.

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.