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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:52:37+00:00 2026-06-03T07:52:37+00:00

I am using knockout.js and upshot.js to get a list of items from API

  • 0

I am using knockout.js and upshot.js to get a list of items from API controller on the server. This is basically my view model:

self.templatesDataSource = upshot.dataSources.Templates.refresh();
self.templates = self.templatesDataSource.getEntities();

Binding to properties works just fine:

<div data-bind="foreach: templates">
    <a href="#" data-bind="text: Title"></a><br />
</div>

But let’s say I want the text to not only display the title, but a combination of the title and some other value? Let’s say I want Title + ' ' + Id. Based on “example 4” from here, I’m thinking I should be able to do something like this:

<div data-bind="foreach: templates">
    <a href="#" data-bind="text: function(item){return item.Title + ' ' + item.Id; }"></a><br />
</div>

However, I see the function text (function(item){...etc) instead of result. I would also need this functionality to construct proper href for the link. How can I accomplish this?

  • 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-03T07:52:39+00:00Added an answer on June 3, 2026 at 7:52 am

    you can just write your statement directly like:

    data-bind="text: Title + " " + Id"
    

    If your properties are observables, then you would do:

    data-bind="text: Title() + " " + Id()"
    

    For binding against href you would do:

    data-bind="attr: { href: Url }"
    

    The other option when you are calculating a value is to use a computed observable to represent the value.

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

Sidebar

Related Questions

I'm using knockout.js to render my view, I'm getting the data from the server
See code (am using Knockout.js over ASP MVC 3): @model List<Person> @{ ViewBag.Title =
I am using Knockout-JS to bind properties in my view to my view model.
I am trying to delete an item from a list. I am using knockout.js
Quite a few examples I see of using knockout when showing a list of
I am using Knockout JS in combination with this combobox extension for jQuery: http://source.dellsala.com/jquery-combobox/demo/
I am using Knockout Js for my view page. I have a requirement where
With Knockout 2.0 using this data-bind: data-bind=click: $root.deleteSomeEntity.bind($data, $parent) in the Knockout viewmodel JavaScript
Using knockout's mapping plugin, how would I go about displaying the information from and
Please see code (Using knockout.js over ASP MVC 3): self.tags = ko.utils.arrayMap(@Html.Raw(new JavaScriptSerializer().Serialize(Model.Tags)), function(tag)

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.