Telerik Forums
Kendo UI for jQuery Forum
1 answer
68 views

I have an autocomplete that users may type in long queries into - the problem is that when they type in long queries the ends of the suggestions are cut of with an ellipsis

We want to keep it a single line, but we want the ellipsis to be on the left of the suggestion so the user can see the end of the autocomplete suggestion instead

See attached

Does anyone know of an easy way to do this? I've tried applying text-align:right and various right based attributes to the autocomplete structure but so far it hasn't worked...

Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 17 Aug 2021
1 answer
74 views
I have an autocomplete Kendo list. Each list item contains some hyperlinks as shown in the attached image. The links are not being accessible using the tab key. Kindly suggest how to fix that.
Neli
Telerik team
 answered on 28 May 2021
1 answer
235 views

Hello. I am using a custom column editor as shown in your example : https://docs.telerik.com/kendo-ui/knowledge-base/custom-editor-autocomplete. Even in the example that you provided, if I type a value that is not in the list, on focus out the field will display "undefined" and will remain this way even if i try to select another value. Is there a fix for this situation? Thank you in advance :)

I attached a screenshot from your working example.

Martin
Telerik team
 answered on 11 May 2021
2 answers
904 views

I have a Autocomplete kendo control. I am selecting some values by doing a filtering after selecting 5 items as shown in the attached image. I am able to retrieve value after individual selection. But I want to get dataValueField for the all the selected items of Autocomplete control in change event. Please find the below code. Kindly suggest in this

$("#Products").kendoAutoComplete({
                        dataSource: result,
                        dataTextField: "TagName",
                        dataValueField:"TagID",
                        filter: "startswith",
                        placeholder: "Select Product...",
                        separator: ", ",
                        select: function (e) {
                            if (e.dataItem) {
                                var dataItem = e.dataItem;
                                alert(dataItem.TagID);//Returns dataValueField value for individual selected item
                                alert(dataItem.TagName);//Returns dataTextField value for individual selected item
                            }
                            if (e.item)
                            {
                                //var dataItem = e.dataItem;
                                var item = e.item;
                                var text = item.text();  //Returns dataTextField value for individual selected item                              
                            }
                        },
                        change: function (e) {
                            alert($("#Products").data("kendoAutoComplete").value());//Returns dataTextField value for multiple selected items
                            var s=$("#Products").data("kendoAutoComplete").value(); //Returns dataTextField value for multiple selected items
                           //Need to get dataValueField for multiple selected items
                        }
                    });

 

Stoyan
Telerik team
 answered on 31 Mar 2021
4 answers
1.6K+ views

I have an auto complete field that pulls in my vendors.  Related to my vendors are pay terms.  On the UI the pay terms is a drop down list.  When I select vendor from the auto complete, how do I get the pay terms to be selected on the drop down list?  Thanks in advance.  

 

<div class="form-group row mt-4">
            @Html.LabelFor(model => model.VendorName, new { @class = "col-sm-3 col-form-label" })
            <div class="col-sm-9">
                @Html.TextBoxFor(model => model.VendorName, new { @class = "form-control", maxlength = "50", type = "text", @id = "txtVendorName" })
                @Html.ValidationMessageFor(model => model.VendorName, "", new { @class = "text-danger" })

                <script id="noDataTemplate" type="text/x-kendo-tmpl">
                    <div>
                        No data found. Do you want to add new vendor - '#: instance.element.val() #' ?
                    </div>
                    <br />
                    <button class="k-button" onclick="addNewVendor('#: instance.element[0].id #', '#: instance.element.val() #')">Add new vendor</button>
                </script>
            </div>
        </div>

 

 <div class="form-group row mt-4">
            @Html.LabelFor(model => model.InvoiceTermID, new { @class = "col-sm-3 col-form-label" })
            <div class="col-sm-9">
                @(Html.Kendo().DropDownListFor(x => x.InvoiceTermID)
                               .OptionLabel("Select Terms")
                               .DataTextField("Text")
                               .DataValueField("Value")
                               .HtmlAttributes(new { style = "width: 100%" , @required = "required", @validationMessage = "The Terms field is required.", id="ddlTermID" })
                               .DataSource(source =>
                               {
                                   source.Read(read =>
                                   {
                                       read.Action("GetInvoiceTermsSelectList", "Dropdown");
                                   });
                               })
                               .Value(Convert.ToString(Model.InvoiceTermID))
                           )
                @Html.ValidationMessageFor(model => model.InvoiceTermID, "", new { @class = "text-danger" })
            </div>
        </div>

 

 

   $(document).ready(function () {
        $("#Date").attr("readonly", true);

        $("#txtVendorName").kendoAutoComplete({
            dataSource: {
                type: "json",
                severFiltering: true,
                serverPaging: true,
                transport: {
                    read: '@Url.Action("GetVendors", "PurchaseOrder")',
                    parameterMap: function (data, type) {
                        return { filter: $('#txtVendorName').val() };
                    }
                }
            },
            clearButton: true,
            filter: "contains",
            dataTextField: "Name",
            minLength: 3,
            placeholder: "Search Vendor Name ...",
            noDataTemplate: $("#noDataTemplate").html(),
            select: onSelectVendor,
            change: function (e) {
                var vendorId = $("#hdnVendorID").val();
                if (vendorId == "" || vendorId == 0) {
                    $("#hdnVendorID").val("");
                    $("#txtVendorName").val("");
                }
            },
            filtering: function (e) {
                $("#hdnVendorID").val("");
            }
        });

 

    function onSelectVendor(e) {
        var dataItem = this.dataItem(e.item.index());        
        if (dataItem && dataItem.VendorID > 0) {
            $("#hdnVendorID").val(dataItem.VendorID);              
            //$("#ddlTermID").val(1);
        }
    }

 

TD
Top achievements
Rank 1
Veteran
 answered on 23 Feb 2021
4 answers
182 views

In my Autocomplete I need to show grouped items, but groups have to be sorted non-alphabetically.

As the Autocomplete doesn't have such option, I tried using the serverGrouping option, but I guess I'm doing something wrong.

In fact the list of groups and items is correctly displayed (see attached picture #1), but typing any character in the input shows the NO DATA FOUND message (see attached picture #2 - typing "c" should show "Coffee" and "Cake"). Additionally items sorting doesn't seem to work.

This is the Autocomplete and its DataSource initialization code:

var dataSource = new kendo.data.DataSource({
    transport: {
        read: {
          url: "xxxxxxxxxxxxxxxxxxxxxx",
          dataType: "json"
        }
    },
    schema: {
        groups: 'groups',
    },
    serverGrouping: true,
    group: {
        field: "category",
    },
    sort: { field: "name", dir: "asc" }
});
 
$("#destinationIn").kendoAutoComplete({
    dataTextField: "name",
    height: 400,
    placeholder: "Ovunque",
    dataSource: dataSource,
});

 

This is the json data returned by the server call:

{
   "groups":[
      {
         "field":"category",
         "value":"Beverages",
         "items":[
            { "name":"Lemonade" },
            { "name":"Tea" },
            { "name":"Coffee" }
         ]
      },
      {
         "field":"category",
         "value":"Seafood",
         "items":[
            { "name":"Salmon" },
            { "name":"Mackerel" }
         ]
      },
      {
         "field":"category",
         "value":"Desserts",
         "items":[
            "name":"Ice cream" },
            { "name":"Cake" }
         ]
      }
   ]
}

 

Why the Autocomplete doesn't seem to work? Am I missing something in the Autocomplete settings, or DataSource settings, or JSON being sent by the server?

And why the sorting of items doesn't work?

Martin
Telerik team
 answered on 11 Jan 2021
3 answers
99 views
When getting results returned back to the autocomplete control that will be displayed to the User, I'd like to filter out blank lines. Lines that are essentially whitespace, of no value to the User. I'd like to filter for that on the client side rather than the server. 
Aleksandar
Telerik team
 answered on 23 Sep 2020
5 answers
599 views

The name of the topic is from the docs. But this recipe doesn't work for  Kendo 2015 Q2 

Open the link bellow 

http://docs.telerik.com/kendo-ui/web/dropdownlist/how-to/prevent-close-on-scroll

And press 'Edit this example'.

In dojo You will see the 'bug'. If You choose library  Q2 or Q2 SP1, You can't scroll list at all.

Work perfectly for Q1 branch.

Video. http://screencast.com/t/3z0uEDleCP​

Petar
Telerik team
 answered on 10 Sep 2020
3 answers
603 views

Need to prevent closing dropdown popup, when user scrolls the page. 

Movie to explain the issue. https://drive.google.com/a/productiveedge.com/file/d/0Bzruk8_x7z70TnFaNVdxYXpiSzg/edit

 In fact, dropdown should be closed only by user click on opened autocomplete again.

Result should be like the dropdowns on this page. http://www.w3schools.com/bootstrap/bootstrap_dropdowns.asp

Thanks in advance.

Petar
Telerik team
 answered on 07 Sep 2020
9 answers
90 views

This is my func userNameAutoCompleteEditor

function userNameAutoCompleteEditor(container, options) {
    $('<input required data-bind="value:' + options.field + '"/>')
        .appendTo(container)
        .kendoAutoComplete({        
            dataTextField: "UserName",
            dataValueField: "UserId",
            filter: "contains",
            minLength: 3,
            //_readMethod: '../Warehouse/SearchUser',
            dataSource: new kendo.data.DataSource({
                transport: {
                    read: {
                        url: '../Warehouse/SearchUser',
                        //data: {
                        //    q: function () {
                        //        return $("#autoComplete").data("kendoAutoComplete").value();
                        //    },
                        //    maxRows: 10,
                        //    username: "demo"
                        //}
                    }
                },
            }),
        });
}

 

    "" " I want to Catch autosearc value go connroller and come back with user name contains value just give me way to take value PLEASE!!!!""

This is my grid column area

grid._columns.push(grid.GridColumn('Id', null, '200px', null, null, null, null, null, null, null, true));
grid._columns.push(grid.GridColumn('User', 'User', '200px', null, "#=User.UserName#", null, null, null, null, null, null, null, null, null, userNameAutoCompleteEditor));
grid._columns.push(grid.GridColumn(null, ' ', '200px', { style: 'text-align:right' }, null, null, null, null, null, null, null, null, null, ['edit', 'destroy']));
Aleksandar
Telerik team
 answered on 01 Sep 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?