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

Grid not editable when using editable: {update: true}

1 Answer 50 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jesper
Top achievements
Rank 1
Jesper asked on 21 Jun 2012, 11:25 AM
I have an editable Grid.
When using just editable: true, the edit function behaves as expected.
However, when using editable: {update: true} the grid is not editable.

Is this a bug? If not, I'm posting my code below:

var dataSourceStatistics = new kendo.data.DataSource({
    batch: true,
    transport: {
        read: {
            data: {
                f:'getOrderSuggestion'
            }
        }
    },
    schema: {
        data: function(data) {
            return data.result.custStats.Record;
        },
        total: function(data) {
            return data.result.custStats.Record.length;
        },
        model:{
            // TODO: id should be EmployeeId
            id: "Employee",
            fields: {
                Employee: {
                },
                EmployeeId: {
                },
                ValueCultureAndExercise: {
                    type: "number",
                    defaultValue: "0",
                    validation: {
                    }
                },
                ValueExercise: {
                    type: "number",
                    defaultValue: "0"
                },
                Company: {
                    editable: false,
                    defaultValue: function() {
                        return "apa";
                    }
                },
                CompanyNo: {
                    editable: false
                },
                Department: {
 
                },
                Total: function () {
                    return this.ValueExercise * 10;
                }
 
            }
        }
    }
});
 
$("#orderGrid").kendoGrid({
    dataSource: dataSourceStatistics,
    editable: {
        update: true,
        destroy: true
    },
    sortable: true,
    selectable: true,
    toolbar: [{name: "create", text: "Lägg till rad"}],
    columns: [
        {
            field: "Employee",
            title: "Namn"
        },
        {
            field: "EmployeeId",
            title: "Anställningsnummer"
        },
        {
            field: "ValueExercise",
            title: "Värde träning"
        },
        {
            field: "ValueCultureAndExercise",
            title: "Värde träning och kultur"
        },
        {
            field: "null",
            title: "Totalt",
            template: "#= ValueCultureAndExercise + ValueExercise#"
        },
        {
            command: "destroy",
            title: "Ta bort"
        }
    ]
});

1 Answer, 1 is accepted

Sort by
0
Jesper
Top achievements
Rank 1
answered on 21 Jun 2012, 01:43 PM
SOLVED:
It turns out, setting editable using an object made the edit mode default to inline. This is contrary to what is stated in the documentation.
Explicitly setting mode to incell solved the problem.
Tags
Grid
Asked by
Jesper
Top achievements
Rank 1
Answers by
Jesper
Top achievements
Rank 1
Share this question
or