Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8168863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:39:53+00:00 2026-06-06T20:39:53+00:00

I am writing a custom binding to use $.expandingTextarea with Knockout.js . Following the

  • 0

I am writing a custom binding to use $.expandingTextarea with Knockout.js.

Following the excellent article Another Look at Custom Bindings for KnockoutJS, I hoped it would be as simple as:

ko.bindingHandlers.expandingTextarea = {
  init: function(element, valueAccessor) {
    $(element).expandingTextarea();
  },
   update: function(element, valueAccessor, aBA, vm) {
    ko.bindingHandlers.value.update(element, valueAccessor, aBA, vm);
    $(element).expandingTextarea("resize");
  }
}

Unfortunately this does not work as expected – i.e. when changes are made to the textarea, the corresponding view model is not updated. Here’s a jsFiddle that illustrates the problem.

How does one create a KO custom binding for the expandingTextarea plugin?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:39:55+00:00Added an answer on June 6, 2026 at 8:39 pm

    Here is the solution on jsFiddle, namely also adding the value binding’s init (which has the code to capture the events specified by the valueUpdate parameter):

    ko.bindingHandlers.expandingTextarea = {
        init: function(element, valueAccessor, aBA, vm) {
            $(element).expandingTextarea();
            ko.bindingHandlers.value.init(element, valueAccessor, aBA, vm);
        },
        update: function(element, valueAccessor, aBA, vm) {
            ko.bindingHandlers.value.update(element, valueAccessor, aBA, vm);
            $(element).expandingTextarea("resize");
        }
    };
    

    I hope this helps someone else! 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a custom binding handler in Knockout. I want to to pass
I am writing a custom .pac script for use with Firefox. Following numerous examples
Has anyone ever tried to use custom binding with SSL in a WCF web
I am writing a custom WCF Binding and I want to run some code
I'm new to writing custom ASP.NET server controls, and I'm encountering the following issue:
I created custom django-admin command. I use this tutorial Writing custom django-admin commands For
I am working through the tutorials on writing custom spring namespace handlers found here:
I am using Spring Framework . While writing custom queries, I am unable check
I'm writing a custom overlay for a Google Map. I have a serious of
I am writing a custom node.js addon by C++ mixed with C program. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.