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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:38:07+00:00 2026-05-25T15:38:07+00:00

I have embedded a big svg in a template view. All svg elements have

  • 0

I have embedded a big svg in a template view. All svg elements have id’s corresponding to guid’s of records in a sproutcore datastore.
Now I have a ‘selected’ boolean porperty on each record.

I want to adjust the corresponding svg element of a record whenever the ‘selected’ property toggles between True and False. The view should reflect changes to the slected property of a record.

I can’t figure out how to set up the bindings/observes to do this. If i would built the svg with sc for each record myself i know how to set up the bindings. But I don’t know how to build bindings when you already have a svg.

model code:

App.Node = SC.Record.extend(
   name : SC.Record.attr(String),
   value : SC.Record.attr(String),
   selected: SC.Record.attr(Boolean),
}),

view code:

App.svg_picture = SC.View.design({

  childViews: 'svgpicture'.w(),

   layout: { left:12, right:12, top:12, bottom:12},

   svgpicture: SC.TemplateView.create({
   /**
   * settings.
   */
   templateName: 'svgtest2',
   nodeBorderColorSel: '#FFB60B',
   nodeColorSel: 'yellow',

   /**
    * Event handling code.
    */
   ....

svg.handlebar example:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" version="1.1" x="manifold" xmlns:xlink="http://www.w3.org/1999/xlink"  >
tank_1</text>
<circle cy="25" cx="70" r="20" id="tank_1"  strokewidth:5; fill:none; "  />

<circle cy="25" cx="120" r="20" id="tank_10" strokewidth:5; fill:none; "  />
<circle cy="25" cx="170" r="20" id="tank_11" strokewidth:5; fill:none; "  />
... etc...
  • 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-25T15:38:07+00:00Added an answer on May 25, 2026 at 3:38 pm

    What worked for me was adding observers to objects myself.

     node.addObserver('selected', this, 'update_node_selected');
    

    node is a Record. now I manually add an observer on the selected property executing ‘update_node_selected’ function on this. which gets a target parameter which is the object and in my case a record.

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

Sidebar

Related Questions

I'm writing mostly embedded code at work. We have a big long-term project that's
I have a Windows module (driver) that has embedded a big chunk of raw
I have embedded a Python interpreter in a C program. Suppose the C program
I have embedded a JTextArea on a JScrollPane and am using that JTextArea for
I have embedded an IronPython engine in a C# application. I want to expose
I need to get pointed in the right direction. I have embedded an Iron
I have an embedded webserver that has a total of 2 Megs of space
I have an embedded PowerPoint presentation in an Excel workbook. How can I edit
I have an embedded flash that is transparent so it looks like part of
We have an embedded device that needs to interact with an enterprise software system.

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.