This is a migrated thread and some comments may be shown as answers.

Kendo autocomplete not working

1 Answer 525 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Devon
Top achievements
Rank 1
Devon asked on 19 May 2016, 10:00 PM

I'm trying to setup auto-completion on a single column in my grid. This is being implemented in a backbone+marionette app. I'm following this example for the implementation http://jsfiddle.net/OnaiBai/Naka3/18

The view is instantiated in my controller. Nothing happens when I enter text into the input box. Also there aren't any JS errors. 

I can include more of the code if necessary. Any ideas on how I can get the auto-completion to work.

Template App.Templates.Search.SearchBoxStuff : 

<label class="search-label" for="searchBox">Search Grid:</label>
<input type="search" id="searchBox" class="k-textbox text-input">

 

View:

App.SearchStuff.GridView = App.Common.Widgets.Grid.extend({
    /**
     * Constructor
     */
    constructor: function (options) {
        App.Common.Widgets.Grid.call(this,
            _.extend({
                toolbar: [
                    { template: App.Templates.Search.SearchBoxStuff }
                ],
                dataSource: {
                    type: 'odata',
                    pageSize: 100,
                    serverFiltering: true,
                    serverPaging: true,
                    serverSorting: true,
                    sort: {
                        field: 'name',
                        dir: 'asc'
                    },
                    schema: {
                        model: {
                            fields: {
                                id: {type: 'number'},
                                name: {type: 'string'}
                             
                    
 
                            }
                        }
                    },
                    transport: {
                        read: {
                            url: '/api/package/search/v1',
                            dataType: 'json',
                            type: 'POST',
                            contentType: 'application/json'
                        },
                        parameterMap: _.bind(this._parameterMap, this)
                    }
                },
                height: 700,
                scrollable: {
                    virtual: true
                },
                selectable: 'row',
                sortable: true,
                pageable: false,
                columns: [{
                    field: 'name',
                    title: 'Name'
                }
 
            }, options));
 
$('.text-input').kendoAutoComplete({
            dataTextField: 'name',
            dataVextField: 'name',
            dataSource: this.dataSource
        });
 
    },

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 23 May 2016, 02:55 PM
Hello Devon,

I will ask you to send us a repro demo that demonstrates the issue. 

In general, if you would like to use the AutoComplete widget as an editor, you will need to bind the model field to the editor. Nevertheless, I will be able to chime in more here once the repro demo is accessible.

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
Grid
Asked by
Devon
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or