0
votes

http://jsfiddle.net/bhoff/ZCyPx/50/

$("#grid").kendoGrid({
    dataSource:{
        data:entries,
        schema:{
            parse:function (response) {
                $.each(response, function (idx, elem) {
                    if (elem.time && typeof elem.time === "string") {
                        elem.time = kendo.parseDate(elem.time, "HH:mm:ss");
                    }
                    if (elem.datetime && typeof elem.datetime === "string") {
                        elem.datetime = kendo.parseDate(elem.datetime, "HH:mm:ss");
                    }
                });
                return response;
            }
        }
    },
    columns:[
        { command: [ "edit" ] },
        { field:"type", title:"Cash Transation Type" },
        { field:"begintime", title:"Begin Time(CT)", format:"{0:hh:mm tt}", editor: timeEditor },
        { field:"endtime", title:"End Time(CT)", format:"{0:hh:mm tt}", editor: timeEditor },
    ],
    editable:"inline",
    navigatable:true
});

Based on my example how do I stop the user from editing my "Cash Transation Type" column?

Does it have something to do with this -> editable:"inline" ?

3
I answered a question a while back that may get you on the right track. stackoverflow.com/questions/23067930/… - Rick S

3 Answers

2
votes

look here

you need to set in the datasource

    <script>
var dataSource = new kendo.data.DataSource({
  schema: {
    model: {
      id: "ProductID",
      fields: {
        ProductID: {
          //this field will not be editable (default value is true)
          editable: false,
          // a defaultValue will not be assigned (default value is false)
          nullable: true
        },
        ProductName: {
          //set validation rules
          validation: { required: true }
        },
        UnitPrice: {
          //data type of the field {Number|String|Boolean|Date} default is String
          type: "number",
          // used when new model is created
          defaultValue: 42,
          validation: { required: true, min: 1 }
        }
      }
    }
  }
});
</script>
0
votes

You would normally set this on your DataSource on the schema.model.fields.

var data = new kendo.data.DataSource({
    schema: {
        model: {
            fields: {
                type: { editable: "false" }
0
votes

Add editable in the field you do not want to enable Edit,

columns:[
        { command: [ "edit" ] },
        { field:"type", title:"Cash Transation Type",  editable: false },
        { field:"begintime", title:"Begin Time(CT)", format:"{0:hh:mm tt}", editor: timeEditor },
        { field:"endtime", title:"End Time(CT)", format:"{0:hh:mm tt}", editor: timeEditor },
        ],
    editable:"inline",
    navigatable:true
});