How to make only some columns editable in KendoGrid?

1 Answer 45 Views
Grid
Aeong
Top achievements
Rank 1
Iron
Aeong asked on 30 Aug 2023, 02:25 AM | edited on 30 Aug 2023, 02:25 AM

Hello kendo practitioners! Always a lot of help.
I am making a Kendo Grid in which only some columns can be edited.
It should work as shown in the picture below.

 

So I tried writing various editable methods like the code below, but it didn't work.


                columns: [
                        {
                            selectable: true,
                            width: "40px"
                        },{
                            field: "docno",
                            title: "Doc. No",
                        },{
                            field: "doctitle",
                            title: "Doc. Title",
                        },{
                            field: "rev",
                            title: "Rev",
                            editable: false
                        },{
                            field: "status",
                            title: "Status",
                            attributes: {editable: false}
                        },{
                            field: "genericDocIndex",
                            title: "Generic Doc Index",
                            attributes: {disabled: true}
                        }
                    ]
How should I write the code? Thanks for always helping me!

1 Answer, 1 is accepted

Sort by
0
Accepted
Jay
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 30 Aug 2023, 08:00 PM
From the columns.editable documentation, it looks like editable is supposed to be a function, e.g. 
                        },{
                            field: "rev",
                            title: "Rev",
                            editable: function(dataItem) { return false; }
                        },{

Aeong
Top achievements
Rank 1
Iron
commented on 31 Aug 2023, 04:51 AM

I Solved! Thank you!!
Tags
Grid
Asked by
Aeong
Top achievements
Rank 1
Iron
Answers by
Jay
Top achievements
Rank 2
Iron
Iron
Veteran
Share this question
or