partly editable not working?

2 posts, 0 answers
  1. 재현
    재현 avatar
    2 posts
    Member since:
    Nov 2017

    Posted 15 Nov 2017 Link to this post

    '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"
                  }]
                }]
    });

     

     

  2. Preslav
    Admin
    Preslav avatar
    516 posts

    Posted 16 Nov 2017 Link to this post

    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.
Back to Top