Solved

knockout js custom binding

Posted on 2015-01-28
4
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

734 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