Author Topic: autocomplete not working for cell in grid page  (Read 3355 times)

infovvk

  • Newbie
  • *
  • Posts: 1
    • View Profile
autocomplete not working for cell in grid page
« on: November 04, 2019, 12:50:51 am »
i tried grid with col with autocomplete editor,

var autoCompleteEditor = function (ui) {
            var $inp = ui.$cell.find("input");

            //initialize the editor
            $inp.autocomplete({
                appendTo: ui.$cell, //for grid in maximized state.
                source: "/origin/getCustomers",
                selectItem: { on: true }, //custom option
                highlightText: { on: true }, //custom option
                minLength: 0
            }).focus(function () {
                //open the autocomplete upon focus               
                $(this).autocomplete("search", "");
            });
        }

its making call getting response but nothing is shown in cell,
my response is {"data":{"id": "101", "name":abc"},{"id": "101", "name":abc"}}

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6307
    • View Profile
Re: autocomplete not working for cell in grid page
« Reply #1 on: November 04, 2019, 10:03:10 am »
response should be in this format:

Code: [Select]
[{"id": "101", "name":"abc"}, {"id": "102", "name": "def"},..]

https://api.jqueryui.com/autocomplete/#option-source