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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Editing and Adding on Grid

Thread ID:





125244 Aug 2,2016 01:27 PM UTC Aug 3,2016 11:13 AM UTC JavaScript 1
Tags: ejGrid
Andrea Perazzolo
Asked On August 2, 2016 01:27 PM UTC

I am not able to reproduce this behavior in my grid layout.
I have a filed that when I want to add a new record is enabled in the Added row, and when is in edit is disabled.
I used the allowEditing property in field column definition, but this works in all the edit / add behavior.
What can I do?
Thanks in advance
Andrea Perazzolo

Venkatesh Ayothi Raman [Syncfusion]
Replied On August 3, 2016 11:13 AM UTC

Hi Andrea, 

Thank you for contacting Syncfusion support. 

If we have set allowEditing false for particular column, then it disables both editing and adding operation in Grid. We have achieved your requirement using actionComplete event in Grid. In this event, we can check the condition while adding the record and remove the disabled attribute when we disable the allowEditing property for particular column. Please refer to the code example, Help document and sample, 

Code example: 
                // the datasource "window.gridData" is referred from jsondata.min.js 
                dataSource: window.gridData, 
                allowFiltering: true, 
                allowPaging: true, 
                pageSettings: { pageSize: 7 }, 
                editSettings: { allowAdding: true, allowEditing: true, allowDeleting: true }, 
                toolbarSettings: { showToolbar: true, toolbarItems: ["search", "add", "edit", "delete", "update", "cancel"] }, 
                actionComplete: "actionComplete", 
                columns: [ 
                             { field: "OrderID", headerText: "Order ID", isPrimaryKey: true, width: 80 }, 
                             { field: "CustomerID", headerText: "Customer ID", allowEditing: false, width: 80 }, 
                             { field: "EmployeeID", headerText: "Employee ID", width: 80, editType: "dropdownedit" }, 
                             { field: "Freight", headerText: "Freight", width: 90, }, 
                             { field: "OrderDate", headerText: "OrderDate", width: 90 }, 
                             { field: "ShipName", headerText: "ShipName", width: 90 }, 
function actionComplete(args) { 
            if (args.requestType == 'add') { 
                var len = this.model.columns.length; 
                for (i = 0; i < len; i++) { 
                    if (args.model.columns[i]["allowEditing"] == false) 
                        $("#" + this._id + args.model.columns[i]["field"]).removeClass("e-disable").removeAttr("disabled");// Remvove the class and attribute for disabled column while adding the record 

Venkatesh Ayothiraman. 


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