user10529531
user10529531

Reputation:

How to handle list of object by jquery autocomplete

I was looking out for the way to get list of objects (properties of class) and paste it to the some controls by searching only name .how can I do taht I used this snipped:

$('#applicant').autocomplete({
            source: '/Home/GetApplicant'
        });

Upvotes: 0

Views: 164

Answers (2)

user10529531
user10529531

Reputation:

finally, I will write a custom code to customize a component by using jquery ajax and tables to keep it temporary and click to a specific cell to retrieve complete data so here is all we need to do : enter image description here

Upvotes: 0

Haris Papadakis
Haris Papadakis

Reputation: 89

According jQuery UI documentation

The datasource is a simple JavaScript array, provided to the widget using the source-option.

I'm attaching you an example.

$( function() {
    var availableTags = [
      "ActionScript",
      "AppleScript",
      "Java",
      "JavaScript",
      "Lisp",
      "Perl",
      "PHP",
      "Python",
      "Ruby",
      "Scala",
      "Scheme"
    ];
    $( "#tags" ).autocomplete({
      source: availableTags
    });
  } );

Your input tag has to have the attribute id="tags".

Upvotes: 0

Related Questions