Solved

knockout js custom binding

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

A Change in PHP Behavior with Session Write Short Circuit (http://php.net/manual/en/book.session.php#116217) (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
Using Quotation Marks in PHP This question (http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28217211.html) seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

813 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

11 Experts available now in Live!

Get 1:1 Help Now