Solved

knockout js custom binding

Posted on 2015-01-28
4
154 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
No problem. Thanks for the points
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

762 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

9 Experts available now in Live!

Get 1:1 Help Now