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. Image for the cookie policy date
close icon

Ejgrid Column Field autofill Issue

I have two fields "user" and "password" in ejgrid. But the fields has set default browser cache value.

In html input text we set to autocomplte="off" to remove that autofill value. But i can not remove that autofill value from ejgrid column field.

How can i do that?

Thanks in advance.

1 Reply

VN Vignesh Natarajan Syncfusion Team February 28, 2019 06:38 AM UTC

Hi Debleena, 
 
Thanks for contacting Syncfusion support.  
 
Query: “How to disable autofill default value username and password from input field in ejgrid?” 
 
From your query, we understand that you need to disable the autofill option for input text box inside the ejGrid edit form. We have achieved your requirement using actionComplete event of ejGrid. Refer the below code example 
 
<script type="text/javascript"> 
        $(function () { 
            $("#Grid").ejGrid({ 
                // the datasource "window.gridData" is referred from jsondata.min.js 
                dataSource: window.gridData, 
                allowPaging: true, 
                actionComplete: function (args) { 
                    if (args.requestType == "beginedit" || args.requestType == "add") { 
                        this.getContentTable().find(".gridform").find("input").attr("autocomplete", "off") // to hide the autoComplete for all the input elements 
 
                        // to hide autoComplete for specific column input box 
                        var id = this.element.attr("id"); 
                        //Grid ID + ColumnName 
                        $("#" + id + "CustomerID").attr("autocomplete", "off"); 
                    } 
                }, 
                editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true }, 
                toolbarSettings: { showToolbar: true, toolbarItems: [ej.Grid.ToolBarItems.Add, ej.Grid.ToolBarItems.Edit, ej.Grid.ToolBarItems.Delete, ej.Grid.ToolBarItems.Update, ej.Grid.ToolBarItems.Cancel] }, 
                columns: [ 
…………………………………………………………………….. 
                ] 
            }); 
 
        }); 
 
    </script> 
  
For your convenience we have prepared a JS playground sample which can be referred below 
 
 
Refer our API documentation for your reference 
 
 
Please get back to us if you have further queries. 
 
Regards, 
Vignesh Natarajan 


Loader.
Live Chat Icon For mobile
Up arrow icon