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 7631925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:29:03+00:00 2026-05-31T06:29:03+00:00

We are using KnockoutJS for handling UI and moving parts in UI. So here

  • 0

We are using KnockoutJS for handling UI and moving parts in UI.

So here is the problem:

We have grid on which we have filter columns. It filters data on tab-out. Recently we received a request to Filter data on Enter. Since knockout provide subscribe method that automatically triggers action i want. Is there a way to have custom implementation of subscribe method which can be triggered on enter.

var triggerQueryIfOk = function () {
    if (!self.isLoading() && !self.isOpening) self.runQuery();
};
self.filters.empName.subscribe(triggerQueryIfOk);
 };

self.getQueryParameters = function () {

    return {
       empName: self.filters.empName()                  };
};

self.runQuery = function () {

    if (!self.isLoading()) {

        self.isLoading(true);

        // prepare query data
        var query = self.getQueryParameters();

        // hit server
        $.ajax({
            url: self.getEmployeesUrl,
            type: "POST",
            data: JSON.stringify(query),
            dataType: "json",
            contentType: "application/json; charset=utf-8",
            success: function (rawInvestmentsData) {
                processEmployees(rawInvestmentsData);
                self.isLoading(false);
            },
            error: function () {
                self.isLoading(false);
            }
        });
    }

};
  • 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-05-31T06:29:04+00:00Added an answer on May 31, 2026 at 6:29 am

    Judah’s answer is close except the onkeydown method should look like this(at least for me it did):

    self.OnSearchTermKeydown = function (me,event){
                if (event.keyCode === 13) { 
                  location.href=searchURL + me.SearchValue;
                  return false;
                }
    
                  return true;
              };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using CoffeeScript and KnockoutJS and have a problem getting the values of my
I have a simple HTML table which is bound using knockoutJS. However, I've added
I am using KnockoutJS and I have an input control that displays a number
I'm binding data to a page using KnockoutJS, the ViewModel is being populated by
From what I have done in past(before using knockoutjs) I would call the tabs()
I'm using KnockoutJS and have a main view and view model. I want a
I'm using Selenium's webdriver, but I've hit upon a problem. I'm using KnockoutJS to
I'm using knockoutjs 2.0 I've been trying to have this table work in IE8
I have a dialog which is used to create 2 sets of data which
I am learning knokcout.js I was using the example in http://www.knockmeout.net/2011/04/utility-functions-in-knockoutjs.html , which is

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.