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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:06:23+00:00 2026-05-30T14:06:23+00:00

I am trying to create a dataform functionality using a datagrid similar to the

  • 0

I am trying to create a dataform functionality using a datagrid similar to the dataform in silverlight.

I have a div to display the selected item from the grid:

$('#readDate').attr('data-bind', 'text : selectedEntry.expenseDate');
$('#readDesc').attr('data-bind', 'text : selectedEntry.expenseDescription');
$('#readAmount').attr('data-bind', 'text : selectedEntry.expenseAmount');

in my view model, I have a function to set the selected item:

this.setSelectedEntry = function (id) {
                 vm.selectedEntry = vm.data()[id];
}

The selected Item is defined like this:

function ExpenseEntry(Id, expenseDate, expenseDescription, expenseAmount) {
             this.Id = Id;
             this.expenseDate = ko.observable(expenseDate);
             this.expenseDescription = ko.observable(expenseDescription);
             this.expenseAmount = ko.observable(expenseAmount);
         }

However, whenever I change the selectedEntry object, the UI is not updated. Is this because the UI is bound to the members of the object and not the object itself? how can I bind to the selectedEntry directly?

  • 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-30T14:06:25+00:00Added an answer on May 30, 2026 at 2:06 pm

    Without seeing your entire code it’s hard to pinpoint the exact issues, but here is a JSFiddle that demonstrates what you are trying to do in a slightly different way:

    http://jsfiddle.net/jearles/wgZ59/50/

    Select ‘Load matrix’ to load a table. You can select any item to populate the details.

    —

    I’m guessing that your issue is in how you are dealing with “selectedEntry”. Knockout will only update bindings if the underlying object is an observable. It looks like you are using a plain JS object. Once you are dealing with an observable, change your bindings to the form ‘selectedEntry().expenseDate’. Note the ()… Knockout creates observables as functions, so you use observableName() to read and observableName(value) to write. As you are using a JavaScript expression you need to use the “read” form. In my example I use a container div so that I can use “with” to setup the outer context, which allows your inner bindings to be just ‘expenseDate’.

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

Sidebar

Related Questions

hi I'm trying create chat using node.js I see example in http://chat.nodejs.org/ I have
I am trying create a data.frame from which to create a graph. I have
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Ok so I am trying create a login script, here I am using PHP5
Trying to create several layers of folders at once C:\pie\applepie\recipies\ without using several different
I trying create a class derivated from System.Web.UI.Page and in override Render i set
All, I am trying create a 'to & fro' animation using jquery animate &
I'm trying create an immutable object and initialise it from xml config file in
I'm trying to use the DataForm to display data. The CurrentItem is bound to
I have several ComboBoxes in a DataForm and am trying to have it so

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.