2
votes

I want to enable editing only for Address field for the below code:
$("#grid").kendoGrid({ columns: [{ field: "name",// create a column bound to the "name" field title: "Name",// set its title to "Name"
},

        {
            field: "age",// create a column bound to the "age" field
            title: "Age" ,// set its title to "Age"           
        },
        {
            field: "doj",
            title: "DOJ",            
        },
        {
            field: "address",
            title: "ADDRESS",            
        },
        { command: [{ name: "destroy", text: "Remove" }, { name: "edit", text: "edit" }] }],
        editable: "popup",
        sortable:true,
        dataSource: [{ name: "Jane", age: 30, address: "Bangalore", }, { name: "John", age: 33, address: "Hyderabad" }]
    });
2

2 Answers

1
votes

Define editable: false & nullable: true to column of database schema.

dataSource = new kendo.data.DataSource({
..
schema: {
           model: {
               id: "YourID",
               fields: {
               YourID: { editable: false, nullable: true },
               address: { editable: false, nullable: true },
               ..
               ..
                   }
                }
            }
..
})
0
votes

You have to set editable: false to the columns.

model: {

    fields: {

        ProductID: {

            editable: false    
        }    
    }    
}