Solved

knockout js custom binding

Posted on 2015-01-28
4
161 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 42

Accepted Solution

by:
Rob Jurd, EE MVE 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 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 40578419
No problem. Thanks for the points
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
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.

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now