Solved

knockout js custom binding

Posted on 2015-01-28
4
168 Views
Last Modified: 2015-01-29
I using a custom binding, for other elements in form the values are properly binding but for one value it is giving the value as
 function d(){if(0<arguments.length){if(!d.equalityComparer||!d.equalityComparer(c,arguments[0]))d.H(),c=arguments[0],d.G();return this}b.r.Wa(d);return c}
this is my custom binding code
ko.bindingHandlers.getter = {
              init: function (element, valueAccessor, allBindingsAccessor, context) {
                  var $el = $(element),
                      thisValue = $el.val();
     
                          valueAccessor()(thisValue);      
              }
          };
0
Comment
Question by:gvkr
  • 2
  • 2
4 Comments
 

Author Comment

by:gvkr
ID: 40575346
i got a response for this question to try using a function thisValue(), but i am getting an exception that String is not a function
0
 
LVL 43

Accepted Solution

by:
Rob earned 500 total points
ID: 40576683
I was going to reply in your other thread but seeing as it is being deleted, I'll reply here.

You're getting that error because the observable valueAccessor is just holding a string.  Can you show the html context where you're using this custom binding?  Do you have an update section of your custom binding?

The knockoutjs extension for chrome I've found invaluable: https://chrome.google.com/webstore/detail/knockoutjs-context-debugg/oddcpmchholgcjgjdnfjmildmlielhof?hl=en-US and should greatly help you in this case.
0
 

Author Comment

by:gvkr
ID: 40577440
The issue was i massing () at when retrieve that value. Thank you for your help
0
 
LVL 43

Expert Comment

by:Rob
ID: 40578419
No problem. Thanks for the points
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Google Analytics setup 5 51
iframe - style elements within an iframe 7 37
Making an "H1" a specific color only on a specific page. 3 27
Reactjs with .NET 3 39
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question