Click here to Skip to main content
15,886,608 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i am trying to create a custom binding for autocomplete usng knocout but i am unable to get. also i tried to use jquery auto complete ... but its not getting worked...

enter code here
JavaScript
var self = this;
self.employeedata = ko.observableArray([]);

//var employeedata = [];

for (i = 0; i < Showdatarecords.empdetails().length ; i++)
{
    self.employeedata.push({
        label: Showdatarecords.empdetails()[i].name(),
        value: Showdatarecords.empdetails()[i].empID()
    });
}

Showdatarecords.empdetails() is an observble array where i am getting list of employee and i am pushing record in another array variable and using that variable as source
JavaScript
    $(function () {
        $("#autocomplete").autocomplete({
          
            source: self.employeedata(),
            //source  :availableTags,
        autoFocus: true 
   });
});

its not working.`enter code here`
Posted
Updated 28-Apr-15 20:43pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900