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

Ejgrid Column Field Issue

Hi,

I have a ejgrid column field named "user".But it has set default value from browser in username field as well as password.

How to remove autofill value from the input field?

In html input field we set autocomplete="off" to remove autofill value. But i can not remove autofill value from ejgrid column field.How can i do that?

Thanks in advance.

4 Replies

VN Vignesh Natarajan Syncfusion Team February 28, 2019 06:40 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 



DG Debleena Guha February 28, 2019 09:06 AM UTC

It is not working yet. It holds the cache browser login credential value as username in the input field.

Please see the attched file image.

Thanks in advance.

Attachment: grid_f5367664.rar


DG Debleena Guha February 28, 2019 09:27 AM UTC

I want to prevent browser from caching form field in ejgrid. Is this possible?


VN Vignesh Natarajan Syncfusion Team March 1, 2019 07:21 AM UTC

Hi Debleena, 
 
Thanks for the update. 
 
Query: “It is not working yet. It holds the cache browser login credential value as username in the input field” 
 
We have analyzed the shared screenshot and found that you are using dialog / dialogTemplate editMode. We are able to reproduce the reported issue while preparing sample as per your screenshot. This is because previously we have provided the solution for inlinemode edit form and individual elements. But in you sample you have used dialog editing. So reported issue is not resolved. 
 
Kindly refer the below code example to disable autocomplete for element inside the dialog. 
 
function complete(args) {            
          if(args.requestType == "beginedit" || args.requestType == "add"){ 
            // to hide autoComplete for specific column input box  
                        var id = this.element.attr("id");  
                        //Grid ID + ColumnName  
                        //we have removed the autocomplete for CustomerID column  
                        $("#" + id + "CustomerID").attr("autocomplete", "off");  
                        // if you are using dialog template kindly use the elment id to diable the autocomplete 
          } 
        } 
 
   
 
If you still facing issue, kindly share the following details which will be helpful for us to validate the reported issue at our end 
 
  1. Share the Grid rendering code
  2. Share the screenshot of script error in console window (if).
  3. Share the video demonstration of reported issue.
  4. If possible share the issue reproducible sample.
 
Regards, 
Vignesh Natarajan. 


Loader.
Up arrow icon