This is a migrated thread and some comments may be shown as answers.

partly editable not working?

1 Answer 658 Views
Grid
This is a migrated thread and some comments may be shown as answers.
재현
Top achievements
Rank 1
재현 asked on 16 Nov 2017, 01:30 AM

'CompanyName' field and 'ContactTitle' field have an editable: false attribute.

However, editing is possible.

https://dojo.telerik.com/akUSOh/2

 

$("#grid").kendoGrid({
  dataSource: {
    type: "odata",
    transport: {
      read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Customers"
    },
  },
  editable : true,
  pageable: true,
  columns: [{
    field: "CompanyName",
    title: "Company Name",
    width: 420,
    editable : false
  },
            {
              title: "Contact Info",
              columns: [{
                field: "ContactTitle",
                title: "Contact Title",
                width: 200,
                editable : false
              },{
                field: "ContactName",
                title: "Contact Name",
                width: 200
              },{
                title: "Location",
                columns: [ {
                  field: "Country",
                  width: 200
                },{
                  field: "City",
                  width: 200
                }]
              },{
                field: "Phone",
                title: "Phone"
              }]
            }]
});

 

 

1 Answer, 1 is accepted

Sort by
0
Preslav
Telerik team
answered on 16 Nov 2017, 02:59 PM
Hello,

The columns.editable configuration expects a function as a parameter. More information about it is available in the relevant API reference:
To disable the editing for a field, set the editable property to false in schema.model.fields. For example:

schema: {
 model: {
    fields: {
     CompanyName: { editable: false, nullable: true },
      ContactTitle: { type:"string", editable: false  },
      ContactName: { type:"string" },
      Country: { type: "string"},
      City: { type: "string"},
      Phone: { type: "string"}
}
}},

For a runnable example, check the modified Dojo: https://dojo.telerik.com/akUSOh/8
 

Regards,
Preslav
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
재현
Top achievements
Rank 1
Answers by
Preslav
Telerik team
Share this question
or