We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Autocomplete in grid edit.

Thread ID:

Created:

Updated:

Platform:

Replies:

146821 Aug 21,2019 02:08 PM UTC Aug 22,2019 05:42 AM UTC JavaScript - EJ 2 1
loading
Tags: Grid
Adam Nester
Asked On August 21, 2019 02:08 PM UTC

Can the grid support Autocomplete instead of Dropdownlist? 

Thavasianand Sankaranarayanan [Syncfusion]
Replied On August 22, 2019 05:42 AM UTC

Hi Adam, 

Greetings from Syncfusion support. 

We can achieve your requirement using the cell edit template feature of our Grid. 

In the below code example we have bound autocomplete for “ShipCountry” column in Grid. 

[index.js] 

var elem; 
var dObj; 
var shipCountryData = ["Italy", "Mexico", "Ireland", "USA", "France", "Germany", "UK", "Finland", "Spain", "Sweden"]; 
 
var grid = new ej.grids.Grid({ 
  dataSource: window.orderDataSource.splice(0, 20), 
  editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Normal', newRowPosition: 'Top' }, 
  allowPaging: true, 
  pageSettings: { pageSize: 5 }, 
  toolbar: ['Add', 'Edit', 'Delete', 'Update', 'Cancel'], 
  columns: [ 
 
      . . . . .  
 
    { 
      field: 'ShipCountry', headerText: 'Ship Country', width: 150, 
      edit: { 
        create: function () { 
          elem = document.createElement('input'); 
          return elem; 
        }, 
        read: function () { 
          return dObj.value; 
        }, 
        destroy: function () { 
          dObj.destroy(); 
        }, 
        write: function (args) { 
          dObj = new ej.dropdowns.AutoComplete({ 
            dataSource: shipCountryData, 
            value: args.rowData["ShipCountry"] ? args.rowData["ShipCountry"] : "", 
          }); 
          dObj.appendTo(elem); 
        } 
      } 
    } 
  ], 
}); 



We have prepared a simple sample in the following link. 


Refer the  help documentation. 


Regards, 
Thavasianand S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon