Autocomplete multiples word

Hi,
Is it possible for the autocomplete control to search for multiple words?



3 Replies 1 reply marked as answer

KR Keerthana Rajendran Syncfusion Team May 27, 2021 05:17 AM UTC

Hi Hector, 

Thanks for contacting Syncfusion support. 

Yes, ejAutocomplete can search multiple words by setting filterType as “contains”. We have prepared a live sample to demonstrate this functionality for your reference. 


Now, the suggestion list will be shown based on the items which contains the search text as shown below.  

 

Refer to the following UG links for more details on this. 




Please let us know if you need further assistance. 

Regards, 
Keerthana.  


Marked as answer

HM Hector Mamani June 15, 2021 03:05 AM UTC

Thanks, another query how can I handle the autocomplete control in a grid that has crud.


PS Pon Selva Jeganathan Syncfusion Team June 15, 2021 02:53 PM UTC

Hi Hector, 
 
Thanks for the update 
 
Query1:  how can I handle the autocomplete control in a grid that has crud. 

From your query, we suggest you to use the column's EditTemplate property so that we can render the AutoComplete to the Grid columns. Please refer to the below code example,


 
<ej:Grid ID="FlatGrid" runat="server" AllowPaging="true"> 
                <EditSettings AllowEditing="true" AllowAdding="true" AllowDeleting="true"></EditSettings> 
        <Columns> 
             
            <ej:Column Field="CustomerID" HeaderText="Customer ID" > 
                     
                    <EditTemplate Create="create" Read="read" Write="write" /> 
                </ej:Column> 
        </Columns> 
    </ej:Grid>    
    <script type="text/javascript">        
        function create() { 
            return $("<input>"); 
        } 
 
        function write(args) { 
            obj = $('#<%= FlatGrid.ClientID %>').ejGrid('instance'); 
            var data = ej.DataManager(obj.model.dataSource).executeLocal(new ej.Query().select("CustomerID")); 
           args.element.ejAutocomplete({ width: "100%", dataSource: data, enableDistinct: true, value: args.rowdata !== undefined? 
            args.rowdata["CustomerID"] : "" });                               
        } 
 
        function read(args) { 
            args.ejAutocomplete('suggestionList').css('display', 'none'); 
            return args.ejAutocomplete("getValue"); 
        } 
            </script> 

Please refer to the below sample,

https://www.syncfusion.com/downloads/support/forum/165827/ze/webform_-sample12830137

Please refer to the below demo link,

https://asp.syncfusion.com/demos/web/grid/edittemplate.aspx?

Please refer to the below documentation link for cell edit template,

https://help.syncfusion.com/aspnet/grid/editing?cs-save-lang=1&cs-lang=js#cell-edit-template

Kindly get back to us for further assistance. 
 
Regards,
Pon selva
 


Loader.
Up arrow icon