0

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" ?

PokéDev
  • 163
  • 4
  • 14
  • I answered a question a while back that may get you on the right track. http://stackoverflow.com/questions/23067930/kendo-ui-grid-conditional-editing/23069275#23069275 – Rick S Oct 17 '14 at 19:19

3 Answers3

2

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>
CMS
  • 3,657
  • 1
  • 27
  • 46
0

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" }
CodingWithSpike
  • 42,906
  • 18
  • 101
  • 138
  • Tried using that, but still doesn't work? model: { id : "id" fields: { type: { editable: "false" } } }, Any suggestions? – PokéDev Oct 20 '14 at 14:43
  • 1
    you need to write like this fields: { type:'string', editable: "false" } – CMS Jun 06 '16 at 07:09
0

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
});
Mhadonis
  • 330
  • 3
  • 11