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

Grid Edition disabled on row, not on column

Thread ID:

Created:

Updated:

Platform:

Replies:

143740 Apr 3,2019 12:46 PM UTC Apr 5,2019 11:58 AM UTC JavaScript - EJ 2 3
loading
Tags: Grid
David Caraiannis
Asked On April 3, 2019 12:46 PM UTC

Hello,

I'im working on a grid which, in case of a specific value of a cell in the row, wouldn't authorize to edit this row.

I could only find a way to allowEditing on column but not on row.

Is there a documentation or sample regarding this subject ? I'm working with ES5.

Regards,
David.

Hariharan J V [Syncfusion]
Replied On April 4, 2019 12:05 PM UTC

Hi David, 

Thanks for contacting Syncfusion support. 

You can disable the editing for a particular row by using the actionBegin event of Grid based on requestType as beginEdit. We have prepared a sample for your requirement. Please find the below sample: 



Please get back to us if you need further assistance 

Regards, 
Hariharan 


David Caraiannis
Replied On April 4, 2019 12:18 PM UTC

Hello,

Thanks for your answer.

Is there not an "allowEditing" like on columns but for rows ? If not, will there be in some future update ?

Hariharan J V [Syncfusion]
Replied On April 5, 2019 11:58 AM UTC

Hi David, 

Thanks for contacting us. 

Query: In the same column, some cells can be editable and some not. It all depends from the value of another cell in the same row. 
 
As per your requirement, we have created a sample for your reference. In the below sample, we need to bind actionBegin event, In that event based on the CustomerID value we can enable or disable editing for shipCountry column in Grid. 

Please check the below code example and sample for more information. 

var grid = new ej.grids.Grid({ 
        dataSource: window.orderDataSource, 
        editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Normal'}, 
        allowPaging: true, 
        pageSettings: { pageCount: 5 }, 
        toolbar: ['Add', 'Edit', 'Delete', 'Update', 'Cancel'], 
        actionBegin: actionBegin, 
        columns: [ 
            { 
                field: 'OrderID', isPrimaryKey: true, headerText: 'Order ID'                validationRules: { required: true, number: true }, width: 140 
            }, 
            { 
                field: 'CustomerID', headerText: 'Customer ID', 
                validationRules: { required: true }, width: 140 
            }, 
           { 
                field: 'ShipCountry', headerText: 'Ship Country', editType: 'dropdownedit', width: 150, 
                edit: { params: { popupHeight: '300px' } } 
            } 
        ], 
    }); 
    grid.appendTo('#Grid'); 
 
    function actionBegin(args) { 
        if (args.requestType === 'beginEdit') { 
           if(args.rowData.CustomerID.includes("V")){ 
             // enable and disable editing for shipCountry column 
             this.columns[2].allowEditing = true; 
           } else { 
             this.columns[2].allowEditing = false; 
           } 
        } 
    } 



Regards, 
Hariharan 


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