New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

KnockoutAutocomplete

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

KnockoutAutocomplete

Autocomplete binding for KnockoutJS

Source
nugetNuGet
Version
1.2.0
Version published
Maintainers
1
Created
Source

How to use the Knockout Autocompletet binding in 5 simple ways.

  • Reference the ko.autocomplete.js file to your site:

  • Add a element that uses the binding: (Configuration) A url that should return a list of json. Items should contain a "id" property and a "label" property A selectCallback function that will be executed when clicking (selecting a item)

     <input type="text" data-bind="autoComplete: search, settings: { url : '/My/Service/ReturnJson', selectCallback : selectItemCallback}"/>
    
  • Add a observable property for your viewmodel self.search = ko.observable('').extend({ throttle: 300 });

    Adding a throttle so we dont make a request to the server each keypress

  • Add a function to your viewmodel that will be executed when clicking ( selecting an item) self.selectItemCallback = function(data) { //dosomething with the selected item console.log(data); }

  • Enyoj!

Keywords

Knockout

FAQs

Package last updated on 24 Aug 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts