AutoComplete returning "TypeError: "".toLowerCase is not a function

1 Answer 1981 Views
AutoComplete
Kathleen
Top achievements
Rank 1
Kathleen asked on 21 Oct 2013, 07:17 PM
I have a very simple strongly typed datasource that consists of Bills:
public class BillName
    {
        public string Bill { get; set; }
    }

And a very simple test case that returns these bills through a WebApi in MVC:

var dataSource = new kendo.data.DataSource({
            transport: {
                read: {
                    url: "/api/NavBillApi/GetAllBills",
                }
            }
        });
        
        $('#searchBills').kendoAutoComplete({
            dataSource: dataSource,
            filter: "startswith",
            dataText: "Bill",
            minLength: 1,
            //ignoreCase: false,
            placeholder: "Select ...",
        });

[HttpGet]
        public IEnumerable<BillName> GetAllBills()
        {
            var billList = _billsService.GetAllBillNames();
            //var x = billList.Count();
            return billList.AsEnumerable();
        }

I have tried every option on the datasource and AutoComplete widgets that I have found in the documentation.  If I uncomment ignoreCase: false, then I get the error: Uncaught TypeError: Object [object Object] has no method 'lastIndexOf'.
I am out of ideas.  Thanks for any help.

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 22 Oct 2013, 07:58 AM
Hello Kathleen,

 
The dataTextField property was not defined correctly in the AutoComplete definition. Check this jsBin demo, which shows how it should be defined.

Regards,
Georgi Krustev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
AutoComplete
Asked by
Kathleen
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or